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

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

Issue 2185223002: Fix not throwing error when redefine eval or arguments in strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update&rebase Created 4 years, 4 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 9faa0a40ea70d40ea96a7d216795a46bcf699e9d..65900225ac9974b0095fdc10a60ad7ea9c7836b1 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6345,6 +6345,25 @@ TEST(DestructuringPositiveTests) {
NULL};
// clang-format on
RunParserSyncTest(context_data, data, kSuccess);
+
+ // v8:5201
+ {
+ const char* context_data[][2] = {
+ {"", ""},
+ {NULL, NULL}
+ };
+
+ const char* data[] = {
+ "var {eval} = {}",
+ "var {arguments} = {}",
+ "'use strict'; var {eval: x} = {eval: 5};",
+ "'use strict'; var {arguments: x} = {arguments: 5};",
+ "(() => { function f({eval = false } = {}) {} })()",
+ NULL,
+ };
+
+ RunParserSyncTest(context_data, data, kSuccess);
+ }
}
@@ -6469,6 +6488,8 @@ TEST(DestructuringNegativeTests) {
"{ a : arguments }",
"[public]",
"{ x : private }",
+ "{eval}",
+ "{arguments}",
adamk 2016/08/17 19:32:51 Can you flesh out this test coverage while you're
lpy 2016/08/19 17:00:40 Done.
NULL};
// clang-format on
RunParserSyncTest(context_data, data, kError);
@@ -6872,6 +6893,25 @@ TEST(DestructuringAssignmentNegativeTests) {
NULL};
RunParserSyncTest(strict_context_data, strict_data, kError);
+
+ // v8:5201
adamk 2016/08/17 19:32:51 Isn't this block now redundant with the tests you
lpy 2016/08/19 17:00:40 Done.
+ {
+ // clang-format off
+ const char* context_data[][2] = {
+ {"'use strict'; var {", "} = {};"},
+ {"(() => { 'use strict'; function a({", " = false } = {}) {} })()"},
+ {NULL, NULL}
+ };
+
+ const char* data[] = {
+ "eval",
+ "arguments",
+ NULL
+ };
+
+ // clang-format on
+ RunParserSyncTest(context_data, data, kError);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698