Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index da39fae3714414bb75966ac528fcd45befa23c3e..ca9063cf99124b01751dc83f639294c27786a907 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -3502,23 +3502,20 @@ TEST(ErrorsArrowFunctions) { |
"(x, (y, z)) => 0", |
"((x, y), z) => 0", |
- // Arrow function formal parameters are parsed as StrictFormalParameters, |
- // which confusingly only implies that there are no duplicates. Words |
- // reserved in strict mode, and eval or arguments, are indeed valid in |
- // sloppy mode. |
- "eval => { 'use strict'; 0 }", |
- "arguments => { 'use strict'; 0 }", |
- "yield => { 'use strict'; 0 }", |
- "interface => { 'use strict'; 0 }", |
- "(eval) => { 'use strict'; 0 }", |
- "(arguments) => { 'use strict'; 0 }", |
- "(yield) => { 'use strict'; 0 }", |
- "(interface) => { 'use strict'; 0 }", |
- "(eval, bar) => { 'use strict'; 0 }", |
- "(bar, eval) => { 'use strict'; 0 }", |
- "(bar, arguments) => { 'use strict'; 0 }", |
- "(bar, yield) => { 'use strict'; 0 }", |
- "(bar, interface) => { 'use strict'; 0 }", |
+ // Parameter lists are always validated as strict, so those are errors. |
+ "eval => {}", |
+ "arguments => {}", |
+ "yield => {}", |
+ "interface => {}", |
+ "(eval) => {}", |
+ "(arguments) => {}", |
+ "(yield) => {}", |
+ "(interface) => {}", |
+ "(eval, bar) => {}", |
+ "(bar, eval) => {}", |
+ "(bar, arguments) => {}", |
+ "(bar, yield) => {}", |
+ "(bar, interface) => {}", |
// TODO(aperez): Detecting duplicates does not work in PreParser. |
// "(bar, bar) => {}", |
@@ -3625,66 +3622,6 @@ TEST(NoErrorsArrowFunctions) { |
} |
-TEST(ArrowFunctionsSloppyParameterNames) { |
- const char* strong_context_data[][2] = { |
- {"'use strong'; ", ";"}, |
- {"'use strong'; bar ? (", ") : baz;"}, |
- {"'use strong'; bar ? baz : (", ");"}, |
- {"'use strong'; bar, ", ";"}, |
- {"'use strong'; ", ", bar;"}, |
- {NULL, NULL} |
- }; |
- |
- const char* strict_context_data[][2] = { |
- {"'use strict'; ", ";"}, |
- {"'use strict'; bar ? (", ") : baz;"}, |
- {"'use strict'; bar ? baz : (", ");"}, |
- {"'use strict'; bar, ", ";"}, |
- {"'use strict'; ", ", bar;"}, |
- {NULL, NULL} |
- }; |
- |
- const char* sloppy_context_data[][2] = { |
- {"", ";"}, |
- {"bar ? (", ") : baz;"}, |
- {"bar ? baz : (", ");"}, |
- {"bar, ", ";"}, |
- {"", ", bar;"}, |
- {NULL, NULL} |
- }; |
- |
- const char* statement_data[] = { |
- "eval => {}", |
- "arguments => {}", |
- "yield => {}", |
- "interface => {}", |
- "(eval) => {}", |
- "(arguments) => {}", |
- "(yield) => {}", |
- "(interface) => {}", |
- "(eval, bar) => {}", |
- "(bar, eval) => {}", |
- "(bar, arguments) => {}", |
- "(bar, yield) => {}", |
- "(bar, interface) => {}", |
- "(interface, eval) => {}", |
- "(interface, arguments) => {}", |
- "(eval, interface) => {}", |
- "(arguments, interface) => {}", |
- NULL |
- }; |
- |
- static const ParserFlag always_flags[] = { kAllowHarmonyArrowFunctions, |
- kAllowStrongMode}; |
- RunParserSyncTest(strong_context_data, statement_data, kError, NULL, 0, |
- always_flags, arraysize(always_flags)); |
- RunParserSyncTest(strict_context_data, statement_data, kError, NULL, 0, |
- always_flags, arraysize(always_flags)); |
- RunParserSyncTest(sloppy_context_data, statement_data, kSuccess, NULL, 0, |
- always_flags, arraysize(always_flags)); |
-} |
- |
- |
TEST(SuperNoErrors) { |
// Tests that parser and preparser accept 'super' keyword in right places. |
const char* context_data[][2] = { |