summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2009-11-23 19:04:52 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2009-11-23 19:04:52 (GMT)
commitcf89e30f6885efb4b63f01e4459f8b277cb52113 (patch)
tree052f43ac4a5a16db04d31ad2272027afc8c2ad0e
parent0ea7b40128bde00868bbab040b337fbc59cc0287 (diff)
downloadQt-cf89e30f6885efb4b63f01e4459f8b277cb52113.zip
Qt-cf89e30f6885efb4b63f01e4459f8b277cb52113.tar.gz
Qt-cf89e30f6885efb4b63f01e4459f8b277cb52113.tar.bz2
update autotest to match 4.6 behavior
In 4.6 the Global Object no longer has an arguments property with undefined value; there should be no such property.
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 3505b5d..3bc2443 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -3063,14 +3063,19 @@ void tst_QScriptEngine::argumentsProperty()
{
{
QScriptEngine eng;
- QEXPECT_FAIL("", "", Continue);
- QVERIFY(eng.evaluate("arguments").isUndefined());
+ {
+ QScriptValue ret = eng.evaluate("arguments");
+ QVERIFY(ret.isError());
+ QCOMPARE(ret.toString(), QString::fromLatin1("ReferenceError: Can't find variable: arguments"));
+ }
eng.evaluate("arguments = 10");
- QScriptValue ret = eng.evaluate("arguments");
- QVERIFY(ret.isNumber());
- QCOMPARE(ret.toInt32(), 10);
- QEXPECT_FAIL("", "", Continue);
- QVERIFY(!eng.evaluate("delete arguments").toBoolean());
+ {
+ QScriptValue ret = eng.evaluate("arguments");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt32(), 10);
+ }
+ QVERIFY(eng.evaluate("delete arguments").toBoolean());
+ QVERIFY(!eng.globalObject().property("arguments").isValid());
}
{
QScriptEngine eng;
@@ -3081,11 +3086,11 @@ void tst_QScriptEngine::argumentsProperty()
}
{
QScriptEngine eng;
+ QVERIFY(!eng.globalObject().property("arguments").isValid());
QScriptValue ret = eng.evaluate("(function() { arguments = 456; return arguments; })()");
QVERIFY(ret.isNumber());
QCOMPARE(ret.toInt32(), 456);
- QEXPECT_FAIL("", "", Continue);
- QVERIFY(eng.evaluate("arguments").isUndefined());
+ QVERIFY(!eng.globalObject().property("arguments").isValid());
}
{