From 1102cefcd75b250d4b42673b8a606d167cb15048 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 30 Aug 2018 22:30:50 +0200 Subject: Fix thisObject when calling super properties Change-Id: Ia520d43ea2c29c16cfc8ffc86a32187a78848502 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4vme_moth.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/qml/jsruntime/qv4vme_moth.cpp') diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index fd2328beaa..2d1f4c3e91 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -689,6 +689,17 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine, CHECK_EXCEPTION; MOTH_END_INSTR(CallValue) + MOTH_BEGIN_INSTR(CallWithReceiver) + STORE_IP(); + Value func = STACK_VALUE(name); + if (Q_UNLIKELY(!func.isFunctionObject())) { + acc = engine->throwTypeError(QStringLiteral("%1 is not a function").arg(func.toQStringNoThrow())); + goto handleUnwind; + } + acc = static_cast(func).call(stack + thisObject, stack + argv, argc); + CHECK_EXCEPTION; + MOTH_END_INSTR(CallWithReceiver) + MOTH_BEGIN_INSTR(CallProperty) STORE_IP(); acc = Runtime::method_callProperty(engine, stack + base, name, stack + argv, argc); -- cgit v1.2.3