diff options
author | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-07-15 13:34:29 (GMT) |
---|---|---|
committer | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-07-17 18:11:25 (GMT) |
commit | 7f04bc3a46d4dd5203b9776c102b487b283a6282 (patch) | |
tree | 4e417b78ed14704d94a1c56ae38411951c27850e /src/script | |
parent | 869450c0f6f5cf654211f79d97d00e0d0058b49c (diff) | |
download | Qt-7f04bc3a46d4dd5203b9776c102b487b283a6282.zip Qt-7f04bc3a46d4dd5203b9776c102b487b283a6282.tar.gz Qt-7f04bc3a46d4dd5203b9776c102b487b283a6282.tar.bz2 |
Fix the return value of a constructor that throws an error.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 2084ddb..c3c7c18 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -2131,8 +2131,10 @@ QScriptValue QScriptValue::construct(const QScriptValueList &args) JSC::ConstructData constructData; JSC::ConstructType constructType = callee.getConstructData(constructData); JSC::JSObject *result = JSC::construct(exec, callee, constructType, constructData, jscArgs); - if (exec->hadException()) + if (exec->hadException()) { eng_p->uncaughtException = exec->exception(); + result = JSC::asObject(exec->exception()); + } return eng_p->scriptValueFromJSCValue(result); } |