Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index cbb79b16da9cc757f385978cb90193f14614163d..613d1de62b51b3d7a292e341f90547da6ed016c4 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -6775,7 +6775,6 @@ TEST(LegacyConst) { |
| }; |
| const char* data[] = { |
| - "const x", |
| "const x = 1", |
| "for (const x = 1; x < 1; x++) {}", |
| "for (const x in {}) {}", |
| @@ -6784,9 +6783,43 @@ TEST(LegacyConst) { |
| }; |
| // clang-format on |
| - static const ParserFlag always_flags[] = {kNoLegacyConst}; |
| + { |
| + static const ParserFlag always_flags[] = {kNoLegacyConst}; |
|
rossberg
2015/07/08 11:49:56
It seems a bit weird to run the LegacyConst test w
arv (Not doing code reviews)
2015/07/08 13:43:45
Agreed and done.
|
| + RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
| + arraysize(always_flags)); |
| + } |
| - RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
| - arraysize(always_flags)); |
| RunParserSyncTest(context_data, data, kSuccess); |
| + |
| + { |
| + static const ParserFlag always_flags[] = {kAllowHarmonySloppy, |
| + kNoLegacyConst}; |
| + RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
| + arraysize(always_flags)); |
| + } |
| +} |
| + |
| + |
| +TEST(LetSloppy) { |
| + // clang-format off |
| + const char* context_data[][2] = { |
| + {"", ""}, |
| + {"'use strict';", ""}, |
| + {"{", "}"}, |
| + {NULL, NULL} |
| + }; |
| + |
| + const char* data[] = { |
| + "let x", |
| + "let x = 1", |
| + "for (let x = 1; x < 1; x++) {}", |
| + "for (let x in {}) {}", |
| + "for (let x of []) {}", |
| + NULL |
| + }; |
| + // clang-format on |
| + |
| + static const ParserFlag always_flags[] = {kAllowHarmonySloppy}; |
| + RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
| + arraysize(always_flags)); |
| } |