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

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

Issue 2290753003: Allow lexically declared "arguments" in function scope in sloppy mode. (Closed)
Patch Set: update Created 4 years, 3 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 | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/bugs/bug-4577.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 befa92a5a1d0e5d953e4d9f024eb8ef15f4627fd..1619518e2193525ad7ba67e7486529a1558e4575 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6444,10 +6444,8 @@ TEST(DestructuringPositiveTests) {
RunParserSyncTest(context_data, data, kSuccess);
// v8:5201
- // TODO(lpy): The two test sets below should be merged once
- // we fix https://bugs.chromium.org/p/v8/issues/detail?id=4577
{
- const char* sloppy_context_data1[][2] = {
+ const char* sloppy_context_data[][2] = {
{"var ", " = {};"},
{"function f(", ") {}"},
{"function f(argument1, ", ") {}"},
@@ -6456,26 +6454,16 @@ TEST(DestructuringPositiveTests) {
{"try {} catch(", ") {}"},
{NULL, NULL}
};
- const char* data1[] = {
+ const char* data[] = {
+ "{arguments}",
"{eval}",
+ "{x: arguments}",
"{x: eval}",
+ "{arguments = false}",
"{eval = false}",
NULL
};
- RunParserSyncTest(sloppy_context_data1, data1, kSuccess);
-
- const char* sloppy_context_data2[][2] = {
- {"var ", " = {};"},
- {"try {} catch(", ") {}"},
- {NULL, NULL}
- };
- const char* data2[] = {
- "{arguments}",
- "{x: arguments}",
- "{arguments = false}",
- NULL,
- };
- RunParserSyncTest(sloppy_context_data2, data2, kSuccess);
+ RunParserSyncTest(sloppy_context_data, data, kSuccess);
}
}
@@ -8330,3 +8318,34 @@ TEST(TrailingCommasInParametersErrors) {
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
}
+
+TEST(ArgumentsRedeclaration) {
+ {
+ const char* context_data[][2] = {
adamk 2016/09/01 21:21:30 To make clang-format happy you'll want to wrap the
adamk 2016/09/01 21:37:59 Sorry to send this back one more time, but general
lpy 2016/09/01 21:47:19 Done.
+ { "function f(", ") {}" },
+ { NULL, NULL }
+ };
+ const char* success_data[] = {
+ "{arguments}",
+ "{arguments = false}",
+ "arg1, arguments",
+ "arg1, ...arguments",
+ NULL
+ };
+ RunParserSyncTest(context_data, success_data, kSuccess);
+ }
+
+ {
+ const char* context_data[][2] = {
+ { "function f() {", "}" },
+ { NULL, NULL }
+ };
+ const char* data[] = {
+ "const arguments = 1",
+ "let arguments",
+ "var arguments",
+ NULL
+ };
+ RunParserSyncTest(context_data, data, kSuccess);
+ }
+}
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/bugs/bug-4577.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698