diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-01-29 13:00:29 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-02-03 15:10:25 +0000 |
commit | bc5cdd23f13d9215bd29e133db7844a19e919e2c (patch) | |
tree | 81ccd60ab5342e949384f4e2ea4f20412f5ff7e1 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | |
parent | f36337359cac10036a17ae787a17340744af0785 (diff) |
parser: Add "let" keyword (& T_LET)
We also tie this up to the existing skeletal "const" support so that they
are also checked for duplicate declarations.
While we do that, change from using a boolean to an enum so we make the scope of
a declaration a little more easily comprehensible.
Change-Id: I6a6e08aed4e16a53690d6f6bafb55632807b6024
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 53d0912d1c..d6f824c9d5 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -8243,6 +8243,16 @@ void tst_qqmlecmascript::constkw_data() "const v = 1\n" << true << QVariant("SyntaxError: Identifier v has already been declared"); + QTest::newRow("const-no-duplicate-let") + << "const v = 1\n" + "let v = 1\n" + << true + << QVariant("SyntaxError: Identifier v has already been declared"); + QTest::newRow("let-no-duplicate-const") + << "let v = 1\n" + "const v = 1\n" + << true + << QVariant("SyntaxError: Identifier v has already been declared"); } void tst_qqmlecmascript::constkw() |