aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-02-21 14:53:58 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2018-02-22 11:17:39 +0000
commitb6d1e97be274e67a47cce950ed4cf05518eebcc8 (patch)
treefd8a26ec1a382f695d91152a6411daefa4dc9ccd /tests
parent8fdf466741f31bc9f33db7b5d09c2e282f0b6bbe (diff)
Remove superfluous assert when traversing IR
When accessing/calling a property on an object, it is possible (and perfectly fine) for that object to be a constant value. I.e. Undefined. All code handling such a call do handle constants correctly. Note: this is a 5.9 specific change, because 5.11 got rid of this code. Task-number: QTBUG-66027 Change-Id: Ied9d0c9c8f8bf958f8634f7be196900b3ea64861 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 14447383c1..6318b12f9f 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -339,6 +339,7 @@ private slots:
void singleBlockLoops();
void qtbug_60547();
void anotherNaN();
+ void callPropertyOnUndefined();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8281,6 +8282,18 @@ void tst_qqmlecmascript::anotherNaN()
object->setProperty("prop", d); // don't crash
}
+void tst_qqmlecmascript::callPropertyOnUndefined()
+{
+ QJSEngine engine;
+ QJSValue v = engine.evaluate(QString::fromLatin1(
+ "function f() {\n"
+ " var base;\n"
+ " base.push(1);"
+ "}\n"
+ ));
+ QVERIFY(!v.isError()); // well, more importantly: this shouldn't fail on an assert.
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"