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

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

Issue 1151503002: [destructuring] Implement spread binding patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments addressed Created 5 years, 7 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 da63f39ae62060198c3f34cf37f02bb1f8ca5185..d99b2b86aea2d96c1bd16c92d05c7d1f3d5d468d 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6395,6 +6395,9 @@ TEST(DestructuringPositiveTests) {
"{[1+1] : z}",
"{[foo()] : z}",
"{}",
+ "[...rest]",
+ "[a,b,...rest]",
+ "[a,,...rest]",
NULL};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals,
@@ -6467,6 +6470,15 @@ TEST(DestructuringNegativeTests) {
"{x : x += a}",
"{m() {} = 0}",
"{[1+1]}",
+ "[...rest, x]",
+ "[a,b,...rest, x]",
+ "[a,,...rest, x]",
+ "[...rest,]",
+ "[a,b,...rest,]",
+ "[a,,...rest,]",
+ "[...rest,...rest1]",
+ "[a,b,...rest,...rest1]",
+ "[a,,..rest,...rest1]",
NULL};
// clang-format on
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,

Powered by Google App Engine
This is Rietveld 408576698