summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-23 07:50:24 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-23 07:50:24 (GMT)
commit4684c2b54f7464e1828bcc5b5a1f997ec315f6f6 (patch)
treebaf68f6de018c2df6e053f01a80b96ea31fdce66 /src/script/api
parentd612b4789f7ec891ada16afbbbf1c13ab0f0e575 (diff)
downloadQt-4684c2b54f7464e1828bcc5b5a1f997ec315f6f6.zip
Qt-4684c2b54f7464e1828bcc5b5a1f997ec315f6f6.tar.gz
Qt-4684c2b54f7464e1828bcc5b5a1f997ec315f6f6.tar.bz2
toObject({undefined,null}) should return invalid scriptvalue
JSC will throw an error.
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 873091b..857019e 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2468,7 +2468,7 @@ QScriptValue QScriptEngine::toObject(const QScriptValue &value)
{
Q_D(QScriptEngine);
JSC::JSValue jscValue = d->scriptValueToJSCValue(value);
- if (!jscValue)
+ if (!jscValue || jscValue.isUndefined() || jscValue.isNull())
return QScriptValue();
JSC::ExecState* exec = d->globalObject->globalExec();
JSC::JSValue result = jscValue.toObject(exec);