Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index 98a27c0327253806da29176adcc8bbb5c0eed12d..6976172b9f6605cf27ac4a6ccc18d39ac3fafa69 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -8007,3 +8007,37 @@ TEST(MiscSyntaxErrors) { |
| RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
| } |
| + |
| +TEST(FunctionSentErrors) { |
| + // clang-format off |
| + const char* context_data[][2] = { |
| + { "'use strict'", "" }, |
| + { "", "" }, |
| + { NULL, NULL } |
| + }; |
| + const char* error_data[] = { |
| + "var x = function.sent", |
| + "function* g() { yield function.s\\u0065nt; }" |
| + }; |
|
adamk
2016/02/16 22:21:55
Think you'll need a NULL here.
|
| + // clang-format on |
| + |
| + bool old_flag = i::FLAG_harmony_function_sent; |
| + i::FLAG_harmony_function_sent = true; |
|
adamk
2016/02/16 22:21:55
Hmm, I suspect this is supposed to have an allow_*
caitp (gmail)
2016/02/16 22:23:48
yeah, I'll add the parser flag accessors in a sepa
|
| + RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
| + i::FLAG_harmony_function_sent = old; |
| +} |
| + |
| +TEST(NewTargetErrors) { |
| + // clang-format off |
| + const char* context_data[][2] = { |
| + { "'use strict'", "" }, |
| + { "", "" }, |
| + { NULL, NULL } |
| + }; |
| + const char* error_data[] = { |
| + "var x = new.target", |
| + "function f() { return new.t\\u0061rget; }" |
| + }; |
|
adamk
2016/02/16 22:21:55
And a NULL here too
|
| + // clang-format on |
| + RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
|
adamk
2016/02/16 22:21:55
You can leave off the last four arguments in a cas
|
| +} |