diff options
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index c3c7c18..79c769a 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1987,8 +1987,10 @@ QScriptValue QScriptValue::call(const QScriptValue &thisObject, JSC::CallData callData; JSC::CallType callType = callee.getCallData(callData); JSC::JSValue result = JSC::call(exec, callee, callType, callData, jscThisObject, jscArgs); - if (exec->hadException()) + if (exec->hadException()) { eng_p->uncaughtException = exec->exception(); + result = exec->exception(); + } return eng_p->scriptValueFromJSCValue(result); } diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 2eff71a..b0df6fd 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2354,10 +2354,8 @@ void tst_QScriptValue::call() { QScriptValue result = fun.call(); - QEXPECT_FAIL("", "Returns null if a function throws an error", Continue); QCOMPARE(result.isError(), true); QCOMPARE(eng.hasUncaughtException(), true); - QEXPECT_FAIL("", "returns null if a function throws an error", Continue); QVERIFY(result.strictlyEquals(eng.uncaughtException())); } } |