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

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

Issue 2255353002: [parser] Allow duplicate __proto__ keys in patterns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: create objectliteral production 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/test262/test262.status » ('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 2b8e0fb3a6c8869409a51280d1395b15065ee832..217fe0b1cdc40defff329c31007c7d62ac8762c2 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6342,6 +6342,7 @@ TEST(DestructuringPositiveTests) {
"[...rest]",
"[a,b,...rest]",
"[a,,...rest]",
+ "{ __proto__: x, __proto__: y}",
"{arguments: x}",
"{eval: x}",
NULL};
@@ -6629,6 +6630,7 @@ TEST(DestructuringAssignmentPositiveTests) {
"{ x : [ foo()[y] = 10 ] = {} }",
"{ x : [ y.z = 10 ] = {} }",
"{ x : [ y[z] = 10 ] = {} }",
+ "{ z : { __proto__: x, __proto__: y } = z }"
"[ x ]",
"[ foo().x ]",
@@ -6748,6 +6750,8 @@ TEST(DestructuringAssignmentPositiveTests) {
"var x; (true ? { x = true } = {} : { x = false } = {})",
"var q, x; (q, { x = 10 } = {});",
"var { x = 10 } = { x = 20 } = {};",
+ "var { __proto__: x, __proto__: y } = {}",
+ "({ __proto__: x, __proto__: y } = {})",
"var { x = 10 } = (o = { x = 20 } = {});",
"var x; (({ x = 10 } = { x = 20 } = {}) => x)({})",
NULL,
@@ -6783,6 +6787,8 @@ TEST(DestructuringAssignmentNegativeTests) {
"{ new.target }",
"{ x: new.target }",
"{ x: new.target = 1 }",
+ "{{ __proto__: x, __proto__: y}}",
adamk 2016/08/19 23:27:35 Why the double braces? Isn't that already an error
+ "({ __proto__: x, __proto__: y})",
adamk 2016/08/19 23:27:35 Same here, I think the parens are already an error
"[x--]",
"[--x = 1]",
"[x()]",
@@ -6870,6 +6876,8 @@ TEST(DestructuringAssignmentNegativeTests) {
"var { x = 10 } = { x = 20 };",
"var { x = 10 } = (o = { x = 20 });",
"var x; (({ x = 10 } = { x = 20 }) => x)({})",
+ "var {{ __proto__: x, __proto__: y}}",
adamk 2016/08/19 23:27:35 And here and below.
+ "({ __proto__: x, __proto__: y}) => ()",
// Not ambiguous, but uses same context data
"switch([window %= []] = []) { default: }",
« no previous file with comments | « src/parsing/parser-base.h ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698