diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-30 19:19:18 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:09:05 +0000 |
commit | 6d8dbba4624c8a453ba13ff009f011f2946422bb (patch) | |
tree | ec1aec45c122a31d7e5c1c19daa9ba5d4f824355 /src/qml/jsruntime/qv4functionobject_p.h | |
parent | deaa99f66ddedc2ea79e6902c665925b04665e68 (diff) |
Add support for super calls
Implement super call support for class constructor
functions.
Change-Id: I3c64276234689cf4f644b095e0fc8ca1c634ac53
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index d2af7fa432..1acb1df0b4 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -122,6 +122,7 @@ DECLARE_HEAP_OBJECT(ScriptFunction, FunctionObject) { struct ConstructorFunction : ScriptFunction { + bool isDerivedConstructor; }; struct MemberFunction : ScriptFunction @@ -130,6 +131,7 @@ struct MemberFunction : ScriptFunction struct DefaultClassConstructorFunction : FunctionObject { + bool isDerivedConstructor; }; #define BoundFunctionMembers(class, Member) \ @@ -180,7 +182,7 @@ struct Q_QML_EXPORT FunctionObject: Object { static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function); - static Heap::FunctionObject *createConstructorFunction(ExecutionContext *scope, Function *function); + static Heap::FunctionObject *createConstructorFunction(ExecutionContext *scope, Function *function, bool isDerivedConstructor); static Heap::FunctionObject *createMemberFunction(ExecutionContext *scope, Function *function); static Heap::FunctionObject *createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, VTable::Call code, int argumentCount); @@ -252,6 +254,7 @@ struct ScriptFunction : FunctionObject { struct ConstructorFunction : ScriptFunction { V4_OBJECT2(ConstructorFunction, ScriptFunction) V4_INTERNALCLASS(ConstructorFunction) + static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); }; |