diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-03-18 17:15:40 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-03-18 17:18:25 (GMT) |
commit | de6b46d64a193278f6f4c0d8967783d47f605ca0 (patch) | |
tree | 0783f5c63c04bd4527ee647acb735fb3824fc355 /src | |
parent | 9b4ca998930c7b81b72e5068b3ebae33907ac4b2 (diff) | |
download | Qt-de6b46d64a193278f6f4c0d8967783d47f605ca0.zip Qt-de6b46d64a193278f6f4c0d8967783d47f605ca0.tar.gz Qt-de6b46d64a193278f6f4c0d8967783d47f605ca0.tar.bz2 |
Don't assert in QScriptValue::call()
Oops, the case of a non-array object argument wasn't implemented
nor tested in the new back-end.
This commit brings it in line with the behavior of the old back-end.
Also test that QScriptValue::construct() doesn't have the same problem.
Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 5bfe46a..8cf01e7 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1946,7 +1946,7 @@ QScriptValue QScriptValue::call(const QScriptValue &thisObject, JSC::MarkedArgumentBuffer applyArgs; if (!array.isUndefinedOrNull()) { if (!array.isObject()) { - return d->engine->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError)); + return d->engine->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); @@ -1957,8 +1957,7 @@ QScriptValue QScriptValue::call(const QScriptValue &thisObject, 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 d->engine->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError, "Arguments must be an array")); } } |