diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 10 |
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 *) |