diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-26 14:18:16 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:08:39 +0000 |
commit | 65e799a9dec58b4bde3a085149f8cbcf0f5f3fba (patch) | |
tree | 4a9473532f420d8f20fc34af60bf1f132d459b82 /src/qml/jsruntime/qv4proxy.cpp | |
parent | 61440411a979c7c317bafccfbf5201d969819a06 (diff) |
Implement support for new.target
Support the new.target meta property in the codegen, and
add support for passing the newtarget into the constructor
vtable methods and the execution context.
Change-Id: I62ea58e5e92d894035a76e35776203e9837c383b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4proxy.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4proxy.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index 082438fc26..794aee8c24 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -477,7 +477,7 @@ bool ProxyObject::virtualSetPrototypeOf(Managed *m, const Object *p) return true; } -//ReturnedValue ProxyObject::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc) +//ReturnedValue ProxyObject::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) //{ //} @@ -499,7 +499,7 @@ void Heap::Proxy::init(QV4::ExecutionContext *ctx) ctor->defineReadonlyConfigurableProperty(scope.engine->id_length(), Primitive::fromInt32(2)); } -ReturnedValue Proxy::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc) +ReturnedValue Proxy::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) { Scope scope(f); if (argc < 2 || !argv[0].isObject() || !argv[1].isObject()) @@ -526,7 +526,7 @@ ReturnedValue Proxy::virtualCall(const FunctionObject *f, const Value *, const V ReturnedValue Proxy::method_revocable(const FunctionObject *f, const Value *, const Value *argv, int argc) { Scope scope(f); - ScopedObject proxy(scope, Proxy::virtualCallAsConstructor(f, argv, argc)); + ScopedObject proxy(scope, Proxy::virtualCallAsConstructor(f, argv, argc, f)); if (scope.hasException()) return Encode::undefined(); |