diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-11-09 01:23:37 (GMT) |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-11-09 01:23:37 (GMT) |
commit | 6b8a95b2521d843ec2b3f7c787c15b92e4ea686f (patch) | |
tree | 346bc8925d83b2729f485d1259729fca931de07d /src/script/api | |
parent | bb8f085611f4cb91b7bde7220d407948edcc572c (diff) | |
parent | e00af84cc9230df411981d2f3b9296b61d5d1c50 (diff) | |
download | Qt-6b8a95b2521d843ec2b3f7c787c15b92e4ea686f.zip Qt-6b8a95b2521d843ec2b3f7c787c15b92e4ea686f.tar.gz Qt-6b8a95b2521d843ec2b3f7c787c15b92e4ea686f.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index f6390bb..f494106 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1736,10 +1736,12 @@ QScriptValue QScriptValue::construct(const QScriptValueList &args) JSC::JSValue savedException; QScriptEnginePrivate::saveException(exec, &savedException); - JSC::JSObject *result = JSC::construct(exec, callee, constructType, constructData, jscArgs); + JSC::JSValue result; + JSC::JSObject *newObject = JSC::construct(exec, callee, constructType, constructData, jscArgs); if (exec->hadException()) { - result = JSC::asObject(exec->exception()); + result = exec->exception(); } else { + result = newObject; QScriptEnginePrivate::restoreException(exec, savedException); } return d->engine->scriptValueFromJSCValue(result); @@ -1796,11 +1798,12 @@ QScriptValue QScriptValue::construct(const QScriptValue &arguments) JSC::JSValue savedException; QScriptEnginePrivate::saveException(exec, &savedException); - JSC::JSObject *result = JSC::construct(exec, callee, constructType, constructData, applyArgs); + JSC::JSValue result; + JSC::JSObject *newObject = JSC::construct(exec, callee, constructType, constructData, applyArgs); if (exec->hadException()) { - if (exec->exception().isObject()) - result = JSC::asObject(exec->exception()); + result = exec->exception(); } else { + result = newObject; QScriptEnginePrivate::restoreException(exec, savedException); } return d->engine->scriptValueFromJSCValue(result); |