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

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

Issue 1070633002: [strong] Implement static restrictions on binding/assignment to 'undefined' identifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 8 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/preparser.cc ('k') | test/mjsunit/strong/undefined.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 6f5708110b64194d9cf8401901948981769a99eb..e1fe1930928b094f8893bc06404c9ea4db7e8a99 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5845,6 +5845,37 @@ TEST(StrongConstructorReturns) {
}
+TEST(StrongUndefinedLocal) {
+ const char* context_data[][2] = {{"", ""}, {NULL}};
+
+ const char* data[] = {
+ "function undefined() {'use strong';}",
+ "function* undefined() {'use strong';}",
+ "(function undefined() {'use strong';});",
+ "{foo: (function undefined(){'use strong';})};",
+ "(function* undefined() {'use strong';})",
+ "{foo: (function* undefined(){'use strong';})};",
+ "function foo(a, b, undefined, c, d) {'use strong';}",
+ "function* foo(a, b, undefined, c, d) {'use strong';}",
+ "(function foo(a, b, undefined, c, d) {'use strong';})",
+ "{foo: (function foo(a, b, undefined, c, d) {'use strong';})};",
+ "(function* foo(a, b, undefined, c, d) {'use strong';})",
+ "{foo: (function* foo(a, b, undefined, c, d) {'use strong';})};",
+ "class C { foo(a, b, undefined, c, d) {'use strong';} }",
+ "class C { *foo(a, b, undefined, c, d) {'use strong';} }",
+ "({ foo(a, b, undefined, c, d) {'use strong';} });",
+ "{ *foo(a, b, undefined, c, d) {'use strong';} });",
+ "class undefined {'use strong'}",
+ "(class undefined {'use strong'});",
+ NULL};
+
+ static const ParserFlag always_flags[] = {kAllowStrongMode};
+
+ RunParserSyncTest(context_data, data, kError, NULL, 0,
+ always_flags, arraysize(always_flags));
+}
+
+
TEST(ArrowFunctionASIErrors) {
const char* context_data[][2] = {{"'use strict';", ""}, {"", ""},
{NULL, NULL}};
« no previous file with comments | « src/preparser.cc ('k') | test/mjsunit/strong/undefined.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698