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

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

Issue 919703003: WIP: Implement ES6 Spread-calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: AssignmentExpressions are not spreadable, add cctests for parsing Created 5 years, 10 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 a59566bd8003ac5175acbff69fccf0d867395204..aef40c3908416a8e3cfa11f9bb6d7e3a96a1cbaf 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -4898,6 +4898,36 @@ TEST(ParseRestParametersErrors) {
}
+TEST(SpreadCall) {
+ const char* context_data[][2] = {{"function fn() { 'use strict';} fn(", ");"},
+ {"function fn() {} fn(", ");"},
+ {NULL, NULL}};
+
+ const char* data[] = {
+ "...([1, 2, 3])",
+ "...'123', ...'456'",
+ "...new Set([1, 2, 3]), 4",
+ "1, ...[2, 3], 4",
+ "...Array(...[1,2,3,4])",
+ "...NaN",
+ NULL};
+ RunParserSyncTest(context_data, data, kSuccess, NULL, 0, NULL, 0);
+}
+
+
+TEST(SpreadCallErrors) {
+ const char* context_data[][2] = {{"function fn() { 'use strict';} fn(", ");"},
+ {"function fn() {} fn(", ");"},
+ {NULL, NULL}};
+
+ const char* data[] = {
+ "(...[1, 2, 3])",
+ "......[1,2,3]",
arv (Not doing code reviews) 2015/02/12 21:41:34 maybe a test for ... outside Arguments?
caitp (gmail) 2015/02/12 21:58:54 will do
+ NULL};
+ RunParserSyncTest(context_data, data, kError, NULL, 0, NULL, 0);
+}
+
+
TEST(LexicalScopingSloppyMode) {
const char* context_data[][2] = {
{"", ""},

Powered by Google App Engine
This is Rietveld 408576698