diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-25 14:58:51 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:08:31 +0000 |
commit | 2aabdd187aae8a953cfcebac8f6c1ba7b19a0727 (patch) | |
tree | 832ef17f2f6433240ec4d329421d119276152792 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 12d8b8c9e4ff05707df7bda479e69d997799c486 (diff) |
Unify the managed and object vtables
Allow for nullptr entries in the vtable. To nevertheless
get some decent error checking if one of the methods is
reimplemented, use a base class for Managed that contains
a full set of the vtable entries all being nullptr's.
Change-Id: Ibc53973b539f87331e8e465a6c44436a30acbefd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index b7b6f83735..69be9a8c84 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -85,8 +85,8 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name, void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name, bool createProto) { - jsCall = reinterpret_cast<const ObjectVTable *>(vtable())->call; - jsConstruct = reinterpret_cast<const ObjectVTable *>(vtable())->callAsConstructor; + jsCall = vtable()->call; + jsConstruct = vtable()->callAsConstructor; Object::init(); this->scope.set(scope->engine(), scope->d()); @@ -103,8 +103,8 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name, void Heap::FunctionObject::init(QV4::ExecutionContext *scope, Function *function, bool createProto) { - jsCall = reinterpret_cast<const ObjectVTable *>(vtable())->call; - jsConstruct = reinterpret_cast<const ObjectVTable *>(vtable())->callAsConstructor; + jsCall = vtable()->call; + jsConstruct = vtable()->callAsConstructor; Object::init(); setFunction(function); @@ -128,8 +128,8 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, const QString &nam void Heap::FunctionObject::init() { - jsCall = reinterpret_cast<const ObjectVTable *>(vtable())->call; - jsConstruct = reinterpret_cast<const ObjectVTable *>(vtable())->callAsConstructor; + jsCall = vtable()->call; + jsConstruct = vtable()->callAsConstructor; Object::init(); this->scope.set(internalClass->engine, internalClass->engine->rootContext()->d()); @@ -193,7 +193,7 @@ Heap::FunctionObject *FunctionObject::createMemberFunction(ExecutionContext *sco return scope->engine()->memoryManager->allocate<MemberFunction>(scope, function); } -Heap::FunctionObject *FunctionObject::createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, jsCallFunction code, int argumentCount) +Heap::FunctionObject *FunctionObject::createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount) { Scope scope(engine); ScopedString name(scope, nameOrSymbol); |