diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-29 16:06:48 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-29 16:06:48 (GMT) |
commit | 7db218d6860a04df238735ff692010f0910d0c92 (patch) | |
tree | ad8033623855b3afb17752552ca56b096c1b9159 /tests/auto/qscriptvalue/tst_qscriptvalue.cpp | |
parent | 8943b44c38ee6244c4a5b190c2b35879b1921843 (diff) | |
parent | c02ef9eb331f03dbd59d2fd938c53b54f5c65cea (diff) | |
download | Qt-7db218d6860a04df238735ff692010f0910d0c92.zip Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.gz Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.bz2 |
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'tests/auto/qscriptvalue/tst_qscriptvalue.cpp')
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 18480cc..5e42921a 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2756,6 +2756,31 @@ void tst_QScriptValue::construct() QVERIFY(!QScriptValue(QScriptValue::NullValue).construct().isValid()); } +void tst_QScriptValue::construct_constructorThrowsPrimitive() +{ + QScriptEngine eng; + QScriptValue fun = eng.evaluate("(function() { throw 123; })"); + QVERIFY(fun.isFunction()); + // construct(QScriptValueList) + { + QScriptValue ret = fun.construct(); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toNumber(), 123.0); + QVERIFY(eng.hasUncaughtException()); + QVERIFY(ret.strictlyEquals(eng.uncaughtException())); + eng.clearExceptions(); + } + // construct(QScriptValue) + { + QScriptValue ret = fun.construct(eng.newArray()); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toNumber(), 123.0); + QVERIFY(eng.hasUncaughtException()); + QVERIFY(ret.strictlyEquals(eng.uncaughtException())); + eng.clearExceptions(); + } +} + void tst_QScriptValue::lessThan_old() { QScriptEngine eng; |