diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-10-11 12:25:09 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-10-15 10:50:50 +0000 |
commit | 1a1e5789c754838473cbb81665667a4d3a42e33b (patch) | |
tree | 51987d628da11e3ccda07c1231115065c8320d1a /tests | |
parent | 67fbdadb3ba1aa9f86ae2d6ca3bff69479fb12be (diff) |
JS: Check lhs of an 'in' expression to be an lvalue
For example: 'for (foo() in something) {}' is not valid: a call
expression is not an lvalue.
Task-number: QTBUG-71086
Change-Id: Ia1498cd38526b073afb8e4524ceaea14dca3d65f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/v4misc/tst_v4misc.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/qml/v4misc/tst_v4misc.cpp b/tests/auto/qml/v4misc/tst_v4misc.cpp index e1796d18b4..ff04be523b 100644 --- a/tests/auto/qml/v4misc/tst_v4misc.cpp +++ b/tests/auto/qml/v4misc/tst_v4misc.cpp @@ -112,6 +112,7 @@ void tst_v4misc::parserMisc_data() QTest::newRow("8[++i][+++i]") << QString("ReferenceError: Prefix ++ operator applied to value that is not a reference."); QTest::newRow("`a${1++}`") << QString("ReferenceError: Invalid left-hand side expression in postfix operation"); QTest::newRow("for (var f in ++!binaryMathg) ;") << QString("ReferenceError: Prefix ++ operator applied to value that is not a reference."); + QTest::newRow("for (va() in obj) {}") << QString("ReferenceError: Invalid left-hand side expression for 'in' expression"); } void tst_v4misc::parserMisc() |