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/qv4generatorobject.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/qv4generatorobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4generatorobject.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4generatorobject.cpp b/src/qml/jsruntime/qv4generatorobject.cpp index d08a6248b8..25da2d0a75 100644 --- a/src/qml/jsruntime/qv4generatorobject.cpp +++ b/src/qml/jsruntime/qv4generatorobject.cpp @@ -54,7 +54,7 @@ void Heap::GeneratorFunctionCtor::init(QV4::ExecutionContext *scope) Heap::FunctionObject::init(scope, QStringLiteral("GeneratorFunction")); } -ReturnedValue GeneratorFunctionCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc) +ReturnedValue GeneratorFunctionCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *) { ExecutionEngine *engine = f->engine(); @@ -70,7 +70,7 @@ ReturnedValue GeneratorFunctionCtor::virtualCallAsConstructor(const FunctionObje // 15.3.1: This is equivalent to new Function(...) ReturnedValue GeneratorFunctionCtor::virtualCall(const FunctionObject *f, const Value *, const Value *argv, int argc) { - return virtualCallAsConstructor(f, argv, argc); + return virtualCallAsConstructor(f, argv, argc, f); } Heap::FunctionObject *GeneratorFunction::create(ExecutionContext *context, Function *function) @@ -84,7 +84,7 @@ Heap::FunctionObject *GeneratorFunction::create(ExecutionContext *context, Funct return g->d(); } -ReturnedValue GeneratorFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *, int) +ReturnedValue GeneratorFunction::virtualCallAsConstructor(const FunctionObject *f, const Value *, int, const Value *) { return f->engine()->throwTypeError(); } |