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

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: Use private own symbol for [[HomeObject]] 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
« no previous file with comments | « src/typing.cc ('k') | test/mjsunit/harmony/super.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 9cb5d69e6c5c1849465a769c2205451cdc7f2421..2dbbc30d8e5deeb35cf55667bdab1a49b979e233 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -3343,3 +3343,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.
+ const char* context_data[][2] = {{"", ";"},
+ {"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.
+ 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);
+}
« no previous file with comments | « src/typing.cc ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698