return d()->internalClass->vtable == QQmlBindingFunction::staticVTable();
}
+bool FunctionObject::isBoundFunction() const
+{
+ return d()->internalClass->vtable == BoundFunction::staticVTable();
+}
+
DEFINE_OBJECT_VTABLE(FunctionCtor);
Heap::FunctionCtor::FunctionCtor(QV4::ExecutionContext *scope)
{
this->boundThis = boundThis;
setVTable(QV4::BoundFunction::staticVTable());
- subtype = FunctionObject::BoundFunction;
Scope s(scope);
ScopedObject f(s, this);
namespace Heap {
struct Q_QML_PRIVATE_EXPORT FunctionObject : Object {
- // Used with Managed::subType
- enum FunctionType {
- RegularFunction = 0,
- WrappedQtMethod = 1,
- BoundFunction
- };
-
enum {
Index_Prototype = 0,
Index_ProtoConstructor = 0
bool needsActivation() const { return d()->needsActivation(); }
bool strictMode() const { return d()->function ? d()->function->isStrict() : false; }
bool isBinding() const;
+ bool isBoundFunction() const;
static void markObjects(Heap::Base *that, ExecutionEngine *e);
};
: Heap::FunctionObject(scope)
{
setVTable(QV4::QObjectMethod::staticVTable());
- subtype = WrappedQtMethod;
}
const QMetaObject *Heap::QObjectMethod::metaObject()
if (!f)
return engine->throwTypeError();
- if (f->subtype() == Heap::FunctionObject::BoundFunction)
+ if (f->isBoundFunction())
f = static_cast<BoundFunction *>(f.getPointer())->target();
ScopedObject v(scope, left->asObject());