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

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

Issue 2695973003: ParserBase should accept ESCAPED_STRICT_RESERVED_WORD as an identifier (Closed)
Patch Set: cctest fixed and ParseIdentifierOrStrictReservedWord recognises ESCAPED_STRICT_RESERVED_WORD Created 3 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 287b61b02c27b9fbbc206fff4b74f5d6b2dce74a..60ee952567ab13fd89ba0547d59245d47c8603c4 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -9449,3 +9449,16 @@ TEST(NoPessimisticContextAllocation) {
}
}
}
+
+TEST(EscapedStrictReservedWord) {
+ // Test that identifiers which are both escaped and only reserved in the
+ // strict mode are accepted in non-strict mode.
+ const char* context_data[][2] = {{"", ""}, {NULL, NULL}};
+
+ const char* statement_data[] = {
+ "if (true) l\u0065t: ;", "function l\u0065t() { }",
+ "(function l\u0065t() { })", "async function l\u0065t() { }",
+ "(async function l\u0065t() { })", "async l\u0065t => 42"};
adamk 2017/02/15 01:25:39 For completeness, can you add a non-async arrow fu
vabr (Chromium) 2017/02/15 01:34:20 Done.
+
+ RunParserSyncTest(context_data, statement_data, kSuccess);
+}

Powered by Google App Engine
This is Rietveld 408576698