diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-29 14:40:34 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-29 18:10:59 +0000 |
commit | cc81e068ee6647dddf404510097060d38801f758 (patch) | |
tree | 9630a47ffc1572386333983ee8e7ec4acddb0ab9 /src/qml/compiler | |
parent | b6018a8167b23988542100312b4f2cd126c41700 (diff) |
Pass the correct new.target to super calls
Change-Id: I648e173a156ffd47564192ecdcb81a03281fdcb4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 3652f09bcd..412d787d11 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2330,11 +2330,10 @@ void Codegen::handleConstruct(const Reference &base, ArgumentList *arguments) if (hasError) return; - if (base.isSuper()) { - Reference::fromStackSlot(this, CallData::Function).loadInAccumulator(); - } else { + if (base.isSuper()) + Reference::fromStackSlot(this, CallData::NewTarget).loadInAccumulator(); + else constructor.loadInAccumulator(); - } if (calldata.hasSpread) { Instruction::ConstructWithSpread create; |