aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-16 23:11:07 +0200
committerLars Knoll <lars.knoll@qt.io>2017-06-20 10:04:23 +0000
commit809d624d0f70874e9acc4617b29f3d97cb27d131 (patch)
treea73e848f3350761e3a84ba35ae48f9d0ee1287bb /src/qml/compiler/qv4codegen.cpp
parenta14407ca599eae8e1b7a119bdba082abe51a17f2 (diff)
Use the proper call for Member references
This is required so the this object gets set up correctly. crypto.js passes now :) Change-Id: I995ffe40b3fee6d8a7b1f9e2d7a9887cd8a87275 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 02183d7b71..a484892b7c 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1688,12 +1688,30 @@ bool Codegen::visit(CallExpression *ast)
if (hasError)
return false;
- Instruction::CallValue call;
- call.dest = base.asRValue();
- call.argc = argc;
- call.callData = 0;
- call.result = r.asLValue();
- bytecodeGenerator->addInstruction(call);
+ if (base.type == Reference::Member) {
+ Instruction::CallProperty call;
+ call.base = base.base;
+ call.name = base.nameIndex;
+ call.argc = argc;
+ call.callData = 0;
+ call.result = r.asLValue();
+ bytecodeGenerator->addInstruction(call);
+ } else if (base.type == Reference::Subscript) {
+ Instruction::CallElement call;
+ call.base = base.base;
+ call.index = base.subscript;
+ call.argc = argc;
+ call.callData = 0;
+ call.result = r.asLValue();
+ bytecodeGenerator->addInstruction(call);
+ } else {
+ Instruction::CallValue call;
+ call.dest = base.asRValue();
+ call.argc = argc;
+ call.callData = 0;
+ call.result = r.asLValue();
+ bytecodeGenerator->addInstruction(call);
+ }
_expr.result = r;
return false;
}