summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-29 16:06:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-29 16:06:48 (GMT)
commit7db218d6860a04df238735ff692010f0910d0c92 (patch)
treead8033623855b3afb17752552ca56b096c1b9159 /src/script/api
parent8943b44c38ee6244c4a5b190c2b35879b1921843 (diff)
parentc02ef9eb331f03dbd59d2fd938c53b54f5c65cea (diff)
downloadQt-7db218d6860a04df238735ff692010f0910d0c92.zip
Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.gz
Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptvalue.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index fbd5d96..e6c3801 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1726,10 +1726,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);
@@ -1786,11 +1788,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);