From cf586d466bea0629b5aa6f96f8e0e97333c44071 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 9 Jul 2009 14:56:34 +0200 Subject: invoke signal handler using JSC::call() Makes sure that new stack frame is set up if the function is native, and all that. --- src/script/bridge/qscriptqobject.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 30c33e1..1dcf602 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -1812,16 +1812,14 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv) JSC::CallData callData; JSC::CallType callType = slot.getCallData(callData); - if (callType == JSC::CallTypeJS) { - if (exec->hadException()) - exec->clearException(); // ### otherwise JSC asserts - (void)JSC::asFunction(slot)->call(exec, thisObject, jscArgs); - } else if (callType == JSC::CallTypeHost) { - (void)callData.native.function(exec, JSC::asObject(slot), thisObject, jscArgs); - } - if (exec->hadException()) + exec->clearException(); // ### otherwise JSC asserts + JSC::call(exec, slot, callType, callData, thisObject, jscArgs); + + if (exec->hadException()) { + engine->uncaughtException = exec->exception(); engine->emitSignalHandlerException(); + } } QObjectConnectionManager::QObjectConnectionManager(QScriptEnginePrivate *eng) -- cgit v0.12