summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-09-25 10:32:17 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-09-25 10:35:45 (GMT)
commitbb62bf61c0577a02003a33bf800025cb85e51b54 (patch)
tree3591f6ab0a3197051b7c5078a3b241297d56cd4b /tests/auto
parentd0d0fdb8e46351b4ab8492de31e5363ef6662b57 (diff)
downloadQt-bb62bf61c0577a02003a33bf800025cb85e51b54.zip
Qt-bb62bf61c0577a02003a33bf800025cb85e51b54.tar.gz
Qt-bb62bf61c0577a02003a33bf800025cb85e51b54.tar.bz2
improve "nested evaluation" test
Test that the variable is stored in the correct activation object. Currently it's marked as an expected failure because it doesn't work with the JSC-based back-end. It did however work with the old back-end, so this is a regression.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index dc7184c..063075d 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -944,6 +944,16 @@ void tst_QScriptContext::inheritActivationAndThisObject()
QVERIFY(ret.isNumber());
QCOMPARE(ret.toInt32(), 123);
}
+
+ // QT-2219
+ {
+ eng.globalObject().setProperty("a", 123);
+ QScriptValue ret = eng.evaluate("(function() { myEval('var a = 456'); return a; })()");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt32(), 456);
+ QEXPECT_FAIL("", "QT-2219: Wrong activation object is returned from native function's parent context", Continue);
+ QVERIFY(eng.globalObject().property("a").strictlyEquals(123));
+ }
}
static QScriptValue parentContextToString(QScriptContext *ctx, QScriptEngine *)