| 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);
|
| +}
|
|
|