diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-25 11:53:41 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-03 08:08:23 +0000 |
commit | 6f79b7519f10ba24485769cf9bf2922e002bd46a (patch) | |
tree | f496f398e8dc452bfb876233244658a6ef911e47 /src/qml/jsruntime/qv4runtime.cpp | |
parent | b262605c806a6572f31cf9a50aab7b0e10cbc951 (diff) |
Add a newTarget parameter to the Construct runtime methods
This is required to be able to support the super() call.
Change-Id: I9998680341d701727ac1697187ad33481bdde422
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 0f3bd66ba4..8b042f12ff 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1302,19 +1302,21 @@ ReturnedValue Runtime::method_callWithSpread(ExecutionEngine *engine, const Valu return static_cast<const FunctionObject &>(function).call(&thisObject, arguments.argv, arguments.argc); } -ReturnedValue Runtime::method_construct(ExecutionEngine *engine, const Value &function, Value *argv, int argc) +ReturnedValue Runtime::method_construct(ExecutionEngine *engine, const Value &function, const Value &/*newTarget*/, Value *argv, int argc) { if (!function.isFunctionObject()) return engine->throwTypeError(); + Q_ASSERT(function.sameValue(newTarget)); return static_cast<const FunctionObject &>(function).callAsConstructor(argv, argc); } -ReturnedValue Runtime::method_constructWithSpread(ExecutionEngine *engine, const Value &function, Value *argv, int argc) +ReturnedValue Runtime::method_constructWithSpread(ExecutionEngine *engine, const Value &function, const Value &/*newTarget*/, Value *argv, int argc) { Q_UNIMPLEMENTED(); if (!function.isFunctionObject()) return engine->throwTypeError(); + Q_ASSERT(function.sameValue(newTarget)); Scope scope(engine); CallArgs arguments = createSpreadArguments(scope, argv, argc); |