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