summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalue.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-06 14:57:06 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-06 14:57:06 (GMT)
commit292f72349a9ff74320f29b12f725bad6c8c283c4 (patch)
tree4511cf525ccc0385cf430a42729e35a1adfdd09f /src/script/api/qscriptvalue.cpp
parent9769235a26c3bacc597b994fa249516721833389 (diff)
downloadQt-292f72349a9ff74320f29b12f725bad6c8c283c4.zip
Qt-292f72349a9ff74320f29b12f725bad6c8c283c4.tar.gz
Qt-292f72349a9ff74320f29b12f725bad6c8c283c4.tar.bz2
fix QScriptValue::construct() when argument is not array-like
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r--src/script/api/qscriptvalue.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index bb8b2b7..cd29810 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -2045,8 +2045,7 @@ QScriptValue QScriptValue::construct(const QScriptValue &arguments)
JSC::MarkedArgumentBuffer applyArgs;
if (!array.isUndefinedOrNull()) {
if (!array.isObject()) {
- Q_ASSERT_X(false, Q_FUNC_INFO, "implement me");
-// return JSC::throwError(exec, JSC::TypeError);
+ return eng_p->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError, "Arguments must be an array"));
}
if (JSC::asObject(array)->classInfo() == &JSC::Arguments::info)
JSC::asArguments(array)->fillArgList(exec, applyArgs);
@@ -2057,8 +2056,7 @@ QScriptValue QScriptValue::construct(const QScriptValue &arguments)
for (unsigned i = 0; i < length; ++i)
applyArgs.append(JSC::asArray(array)->get(exec, i));
} else {
- Q_ASSERT_X(false, Q_FUNC_INFO, "implement me");
-// return JSC::throwError(exec, JSC::TypeError);
+ return eng_p->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError, "Arguments must be an array"));
}
}