Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 942c5be02a6724efe810f52b05dc4c83b2331579..ff996bb91e1dc66716188e78c5e5f0ef4fe16d68 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -6830,6 +6830,21 @@ TEST(DestructuringAssignmentPositiveTests) { |
{"var x, y, z; for (x of ", " = {});"}, |
{NULL, NULL}}; |
+ const char* mixed_assignments_context_data[][2] = { |
+ {"'use strict'; let x, y, z; (", " = z = {});"}, |
+ {"var x, y, z; (", " = z = {});"}, |
+ {"'use strict'; let x, y, z; (x = ", " = z = {});"}, |
+ {"var x, y, z; (x = ", " = z = {});"}, |
+ {"'use strict'; let x, y, z; for (x in ", " = z = {});"}, |
+ {"'use strict'; let x, y, z; for (x in x = ", " = z = {});"}, |
+ {"'use strict'; let x, y, z; for (x of ", " = z = {});"}, |
+ {"'use strict'; let x, y, z; for (x of x = ", " = z = {});"}, |
+ {"var x, y, z; for (x in ", " = z = {});"}, |
+ {"var x, y, z; for (x in x = ", " = z = {});"}, |
+ {"var x, y, z; for (x of ", " = z = {});"}, |
+ {"var x, y, z; for (x of x = ", " = z = {});"}, |
+ }; |
+ |
// clang-format off |
const char* data[] = { |
"x", |
@@ -6945,8 +6960,8 @@ TEST(DestructuringAssignmentPositiveTests) { |
"[...x]", |
"[x,y,...z]", |
"[x,,...z]", |
- "{ x: y } = z", |
- "[x, y] = z", |
+ "{ x: y }", |
+ "[x, y]", |
"{ x: y } = { z }", |
"[x, y] = { z }", |
"{ x: y } = [ z ]", |
@@ -6966,6 +6981,9 @@ TEST(DestructuringAssignmentPositiveTests) { |
RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
arraysize(always_flags)); |
+ RunParserSyncTest(mixed_assignments_context_data, data, kSuccess, NULL, 0, |
+ always_flags, arraysize(always_flags)); |
+ |
const char* empty_context_data[][2] = { |
{"'use strict';", ""}, {"", ""}, {NULL, NULL}}; |