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

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: more oops 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
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/message/function-sent-escaped.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 98a27c0327253806da29176adcc8bbb5c0eed12d..9431a4d28eca974867cd534650c626cd9ca46ca2 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -8007,3 +8007,39 @@ 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; }",
+ NULL
+ };
+ // clang-format on
+
+ bool old_flag = i::FLAG_harmony_function_sent;
+ i::FLAG_harmony_function_sent = true;
+ RunParserSyncTest(context_data, error_data, kError);
+ i::FLAG_harmony_function_sent = old_flag;
+}
+
+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; }",
+ NULL
+ };
+ // clang-format on
+ RunParserSyncTest(context_data, error_data, kError);
+}
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/message/function-sent-escaped.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698