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/qv4objectproto.cpp | |
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/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 2c8227887f..65e9b836d1 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -63,14 +63,14 @@ void Heap::ObjectCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("Object")); } -ReturnedValue ObjectCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) +ReturnedValue ObjectCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { ExecutionEngine *v4 = f->engine(); - const ObjectCtor *ctor = static_cast<const ObjectCtor *>(f); + const ObjectCtor *nt = static_cast<const ObjectCtor *>(newTarget); if (!argc || argv[0].isUndefined() || argv[0].isNull()) { Scope scope(v4); ScopedObject obj(scope, scope.engine->newObject()); - ScopedObject proto(scope, ctor->get(scope.engine->id_prototype())); + ScopedObject proto(scope, nt->get(scope.engine->id_prototype())); if (!!proto) obj->setPrototypeOf(proto); return obj.asReturnedValue(); |