Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: test/cctest/test-parsing.cc

Issue 1094653002: Revert "Factor formal argument parsing into ParserBase" (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/preparser.cc ('k') | test/message/formal-parameters-bad-rest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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] = {
« no previous file with comments | « src/preparser.cc ('k') | test/message/formal-parameters-bad-rest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698