diff options
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
| -rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 30 |
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; } |
