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

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 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
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/strict-mode-eval.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 090a9d00e7318f05e80393dc37a72c046089a8aa..3f93db2932ecefeba0efa7b006e37bfe03bb3f30 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6550,6 +6550,22 @@ TEST(DestructuringAssignmentPositiveTests) {
NULL,
};
RunParserSyncTest(empty_context_data, ambiguity_data, kSuccess);
+
+ // v8:5201
+ {
+ const char* context_data[][2] = {
+ {"var {", "} = {};"},
+ {"(() => { function f({", " = false } = {}) {} })()"},
+ {NULL, NULL}
+ };
+
+ const char* data[] = {
+ "eval",
adamk 2016/08/09 17:00:51 I think this test case belongs with the other dest
+ NULL,
+ };
+
+ RunParserSyncTest(context_data, data, kSuccess);
+ }
}
@@ -6715,6 +6731,25 @@ TEST(DestructuringAssignmentNegativeTests) {
NULL};
RunParserSyncTest(strict_context_data, strict_data, kError);
+
+ // v8:5201
+ {
+ // 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);
+ }
}
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/mjsunit/strict-mode-eval.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698