diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-03-09 13:04:53 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-03-26 09:35:32 +0000 |
commit | 9a2cfd515534c336e867a9d33a3d99b6c6ebd1a1 (patch) | |
tree | 648abf2576c7c0c9492e953f3982351235f30893 /tests/auto | |
parent | 106631254f1c4d322d2347477725f6d0ed28faac (diff) |
Add test for jump strict-not-equal undefined on 32bit
Commit 86702c3be53fda404ebe331207f9062675c952e0 and
e2218f8b5c527a6da52ae4dc8a381b3ff68d3cd0 were submitted directly to the
5.9 and 5.6 branches. As the problem does not exist per-se in 5.11 there
is no fix required. This commit only adds the test coverage for this
issue to avoid regressing.
Change-Id: Ic5f5d56f52f3855d20755f771804025f8a93acd9
Task-number: QTBUG-66832
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 31cf40be16..e0b8127dfb 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -351,6 +351,7 @@ private slots: void shadowedFunctionName(); void anotherNaN(); void callPropertyOnUndefined(); + void jumpStrictNotEqualUndefined(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -8479,6 +8480,26 @@ void tst_qqmlecmascript::callPropertyOnUndefined() QVERIFY(!v.isError()); // well, more importantly: this shouldn't fail on an assert. } +void tst_qqmlecmascript::jumpStrictNotEqualUndefined() +{ + QJSEngine engine; + QJSValue v = engine.evaluate(QString::fromLatin1( + "var ok = 0\n" + "var foo = 0\n" + "if (foo !== void 1)\n" + " ++ok;\n" + "else\n" + " --ok;\n" + "if (foo === void 1)\n" + " --ok;\n" + "else\n" + " ++ok;\n" + "ok\n" + )); + QVERIFY(!v.isError()); + QCOMPARE(v.toInt(), 2); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" |