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

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

Issue 1700123003: [parser] unify metaproperty parsing and require unescaped property name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add test-parsing tests review Created 4 years, 10 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 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
+}

Powered by Google App Engine
This is Rietveld 408576698