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/compiler/qv4codegen.cpp | |
parent | b262605c806a6572f31cf9a50aab7b0e10cbc951 (diff) | |
download | qtdeclarative-6f79b7519f10ba24485769cf9bf2922e002bd46a.tar.gz |
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/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index cab99b0c21..9bc9567be6 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2215,8 +2215,9 @@ bool Codegen::visit(NewExpression *ast) Reference base = expression(ast->expression); if (hasError) return false; - //### Maybe create a ConstructA that takes an accumulator? + base = base.storeOnStack(); + base.loadInAccumulator(); Instruction::Construct create; create.func = base.stackSlot(); @@ -2243,6 +2244,8 @@ bool Codegen::visit(NewMemberExpression *ast) if (hasError) return false; + base.loadInAccumulator(); + if (calldata.hasSpread) { Instruction::ConstructWithSpread create; create.func = base.stackSlot(); |