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

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

Issue 1532873004: [es6] enable destructuring rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update test262 expectations Created 4 years, 11 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/parsing/parser-base.h ('k') | test/mjsunit/es6/rest-params.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 7211e7885c6a5a9439eeaab3bcdf9ee4b309ae88..71cffa65797be0b9b799ec111345cbd28f682c50 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5295,21 +5295,27 @@ TEST(ParseRestParameters) {
"/regexp/, 'str', function(){});"},
{NULL, NULL}};
- const char* data[] = {
- "...args",
- "a, ...args",
- "... args",
- "a, ... args",
- "...\targs",
- "a, ...\targs",
- "...\r\nargs",
- "a, ...\r\nargs",
- "...\rargs",
- "a, ...\rargs",
- "...\t\n\t\t\n args",
- "a, ... \n \n args",
- NULL};
- RunParserSyncTest(context_data, data, kSuccess);
+ const char* data[] = {"...args",
+ "a, ...args",
+ "... args",
+ "a, ... args",
+ "...\targs",
+ "a, ...\targs",
+ "...\r\nargs",
+ "a, ...\r\nargs",
+ "...\rargs",
+ "a, ...\rargs",
+ "...\t\n\t\t\n args",
+ "a, ... \n \n args",
+ "...{ length, 0: a, 1: b}",
+ "...{}",
+ "...[a, b]",
+ "...[]",
+ "...[...[a, b, ...c]]",
+ NULL};
+ static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
+ RunParserSyncTest(context_data, data, kSuccess, nullptr, 0, always_flags,
+ arraysize(always_flags));
}
@@ -7202,30 +7208,6 @@ TEST(DestructuringDisallowPatternsInSingleParamArrows) {
}
-TEST(DestructuringDisallowPatternsInRestParams) {
- i::FLAG_harmony_destructuring_bind = true;
- static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
- const char* context_data[][2] = {{"'use strict';", ""},
- {"function outer() { 'use strict';", "}"},
- {"", ""},
- {"function outer() { ", "}"},
- {nullptr, nullptr}};
-
- // clang-format off
- const char* error_data[] = {
- "function(...{}) {}",
- "function(...{x}) {}",
- "function(...[x]) {}",
- "(...{}) => {}",
- "(...{x}) => {}",
- "(...[x]) => {}",
- nullptr};
- // clang-format on
- RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags,
- arraysize(always_flags));
-}
-
-
TEST(DefaultParametersYieldInInitializers) {
// clang-format off
const char* sloppy_function_context_data[][2] = {
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/es6/rest-params.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698