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

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

Issue 987083003: [es6] support rest parameters in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix preparser bug Created 5 years, 9 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
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 6bbd4e96132c5b5187e779d40e4030faab57d2d3..780fd5b0e6ac4b90d4e9851e0520ab6ecf43be3c 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -4821,6 +4821,8 @@ TEST(ParseRestParameters) {
"function(){});"},
{"(function(", "){ return args;})(1, [],"
"/regexp/, 'str', function(){});"},
+ {"((", ") => args)(1, [], /regexp/, 'str',"
+ "function(){});"},
{NULL, NULL}};
const char* data[] = {
@@ -4837,7 +4839,8 @@ TEST(ParseRestParameters) {
"...\t\n\t\t\n args",
"a, ... \n \n args",
NULL};
- static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
+ static const ParserFlag always_flags[] =
+ {kAllowHarmonyRestParameters, kAllowHarmonyArrowFunctions};
RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
arraysize(always_flags));
}
@@ -4849,6 +4852,8 @@ TEST(ParseRestParametersErrors) {
"function(){});"},
{"(function(", "){ return args;}(1, [],"
"/regexp/, 'str', function(){});"},
+ {"((", ") => args)(1, [], /regexp/, 'str',"
+ "function(){});"},
{NULL, NULL}};
const char* data[] = {
@@ -4869,7 +4874,8 @@ TEST(ParseRestParametersErrors) {
"a,\ra, ...args",
"a,\na, ...args",
NULL};
- static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
+ static const ParserFlag always_flags[] =
+ {kAllowHarmonyRestParameters, kAllowHarmonyArrowFunctions};
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
}
« src/scanner.cc ('K') | « src/typing.cc ('k') | test/mjsunit/harmony/rest-params.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698