diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-11-29 11:05:04 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-11-29 11:38:51 +0000 |
commit | 2fa1c92cb7e60f89e200eff48cf7e76d8d2febe6 (patch) | |
tree | 4b3218530ade7938bc25adcc4c43a6126866b29c /tests | |
parent | 597ce09c7a1d8b89e9473faae900321ef2d4181d (diff) |
Fix parsing of js files via Qt.include()
Make sure to parse them as JavaScript, not as QML, so that certain
keywords such as char or double map to identifiers as expected.
Also removed an unused function.
Fixes: QTBUG-71524
Change-Id: Ie8a8dabe717ee12def6af512943e6d01efcf9876
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/js/include2.js | 5 | ||||
-rw-r--r-- | tests/auto/qml/v4misc/tst_v4misc.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/js/include2.js b/tests/auto/qml/qqmlecmascript/data/js/include2.js index 2a0c039dfa..7cfcdd95e2 100644 --- a/tests/auto/qml/qqmlecmascript/data/js/include2.js +++ b/tests/auto/qml/qqmlecmascript/data/js/include2.js @@ -2,3 +2,8 @@ test2 = true var test2_1 = true Qt.include("include3.js"); + +function withTokensAllowedInJSButKeywordsInQML(char) +{ + var double; +} diff --git a/tests/auto/qml/v4misc/tst_v4misc.cpp b/tests/auto/qml/v4misc/tst_v4misc.cpp index 71f0a42907..2412ca7f92 100644 --- a/tests/auto/qml/v4misc/tst_v4misc.cpp +++ b/tests/auto/qml/v4misc/tst_v4misc.cpp @@ -61,7 +61,7 @@ void tst_v4misc::tdzOptimizations() QFETCH(QString, scriptToCompile); QV4::ExecutionEngine v4; - QV4::Script script(&v4, nullptr, scriptToCompile); + QV4::Script script(&v4, nullptr, /*parse as binding*/false, scriptToCompile); script.parse(); QVERIFY(!v4.hasException); |