aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine/tst_qjsengine.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-05-09 13:10:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-02 16:13:15 +0200
commitbc9e86ef5813f6c2b28a2e10324cf0a2401e53df (patch)
tree18d6ee1951b875c982303f1535fca729cbce1c65 /tests/auto/qml/qjsengine/tst_qjsengine.cpp
parentb366e5509b2dcc6df73fc20d4167d663c6cad763 (diff)
V4: support calling constants.
Consider: function f() { var a; a(); } Here the constant propagation will propagate the value for a (undefined) to the call site. This was not yet handled, resulting in Q_UNIMPLEMENTED warnings when running a debug build. Change-Id: I5f85f681d975b54df7a9e00bd5b50e6f4350139a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 17acb4fd32..94f62a56bb 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -159,6 +159,8 @@ private slots:
void scopeOfEvaluate();
+ void callConstants();
+
signals:
void testSignal();
};
@@ -3050,6 +3052,15 @@ void tst_QJSEngine::scopeOfEvaluate()
QCOMPARE(result.toInt(), 42);
}
+void tst_QJSEngine::callConstants()
+{
+ QJSEngine engine;
+ engine.evaluate("function f() {\n"
+ " var one; one();\n"
+ " var two = null; two();\n"
+ "}\n");
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"