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

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

Issue 418143007: FYI Implementing 'super' keyword (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: one more test Created 6 years, 4 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 74ece30680ad3927d7eab8a1a4904f96d5c3e291..303acbaf9b9b515612649950518a3b36ddafcc49 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -3347,3 +3347,47 @@ TEST(NoErrorsArrowFunctions) {
RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0,
always_flags, ARRAY_SIZE(always_flags));
}
+
+
+TEST(NoErrorsSuper) {
+ // Tests that parser and preparser accept valid arrow functions syntax.
marja 2014/08/11 10:38:15 Nit: this comment is out of date.
+ const char* context_data[][2] = {{"", ";"},
marja 2014/08/11 10:38:15 You can probably get rid of some of the contexts o
+ {"bar ? (", ") : baz;"},
+ {"bar ? baz : (", ");"},
+ {"bar, ", ";"},
+ {"", ", bar;"},
+ {NULL, NULL}};
+
+ const char* statement_data[] = {
+ "super.x",
+ "super[27]",
+ "new super",
+ "new super()",
+ "new super(12, 45)",
+ "new new super",
+ "new new super()",
+ "new new super()()",
+ NULL};
+
+ RunParserSyncTest(context_data, statement_data, kSuccess);
+}
+
+
+TEST(ErrorsSuper) {
+ // Tests that parser and preparser accept valid arrow functions syntax.
marja 2014/08/11 10:38:15 Same here.
+ const char* context_data[][2] = {{"", ";"},
+ {"bar ? (", ") : baz;"},
+ {"bar ? baz : (", ");"},
+ {"bar, ", ";"},
+ {"", ", bar;"},
+ {NULL, NULL}};
+
+ const char* statement_data[] = {
+ "super = x",
+ "y = super",
+ "f(super)",
+ // "z.super",
+ NULL};
+
+ RunParserSyncTest(context_data, statement_data, kError);
+}

Powered by Google App Engine
This is Rietveld 408576698