From bb62bf61c0577a02003a33bf800025cb85e51b54 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 25 Sep 2009 12:32:17 +0200 Subject: 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. --- tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 *) -- cgit v0.12