Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 37b40e37ae3bb204d045b4531ff948c901cee7ad..cdec0a0aa1cf6beeb9280d5701112b2ca2cf7d0b 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -8707,7 +8707,9 @@ class ScopeTestHelper { |
int inner_scope_count = 0; |
for (Scope* inner = scope->inner_scope(); inner != nullptr; |
inner = inner->sibling()) { |
- ++inner_scope_count; |
+ if (!inner->is_hidden()) { |
+ ++inner_scope_count; |
+ } |
} |
CHECK_EQ(data->backing_store_[index++], inner_scope_count); |
@@ -8739,7 +8741,9 @@ class ScopeTestHelper { |
for (Scope* inner = scope->inner_scope(); inner != nullptr; |
inner = inner->sibling()) { |
- CompareScopeToData(inner, data, index); |
+ if (!inner->is_hidden()) { |
+ CompareScopeToData(inner, data, index); |
+ } |
} |
} |
}; |
@@ -9100,6 +9104,36 @@ TEST(PreParserScopeAnalysis) { |
{"", "const arguments = 5;"}, |
{"", "if (true) { const arguments = 5; }"}, |
{"", "const arguments = 5; function f() { arguments; }"}, |
+ |
+ {"", "var [var1, var2] = [1, 2];"}, |
+ {"", "var [var1, var2, [var3, var4]] = [1, 2, [3, 4]];"}, |
+ {"", "var [{var1: var2}, {var3: var4}] = [{var1: 1}, {var3: 2}];"}, |
+ {"", "var [var1, ...var2] = [1, 2, 3];"}, |
+ |
+ {"", "var {var1: var2, var3: var4} = {var1: 1, var3: 2};"}, |
+ {"", |
+ "var {var1: var2, var3: {var4: var5}} = {var1: 1, var3: {var4: 2}};"}, |
+ {"", "var {var1: var2, var3: [var4, var5]} = {var1: 1, var3: [2, 3]};"}, |
+ |
+ {"", "let [var1, var2] = [1, 2];"}, |
+ {"", "let [var1, var2, [var3, var4]] = [1, 2, [3, 4]];"}, |
+ {"", "let [{var1: var2}, {var3: var4}] = [{var1: 1}, {var3: 2}];"}, |
+ {"", "let [var1, ...var2] = [1, 2, 3];"}, |
+ |
+ {"", "let {var1: var2, var3: var4} = {var1: 1, var3: 2};"}, |
+ {"", |
+ "let {var1: var2, var3: {var4: var5}} = {var1: 1, var3: {var4: 2}};"}, |
+ {"", "let {var1: var2, var3: [var4, var5]} = {var1: 1, var3: [2, 3]};"}, |
+ |
+ {"", "const [var1, var2] = [1, 2];"}, |
+ {"", "const [var1, var2, [var3, var4]] = [1, 2, [3, 4]];"}, |
+ {"", "const [{var1: var2}, {var3: var4}] = [{var1: 1}, {var3: 2}];"}, |
+ {"", "const [var1, ...var2] = [1, 2, 3];"}, |
+ |
+ {"", "const {var1: var2, var3: var4} = {var1: 1, var3: 2};"}, |
+ {"", |
+ "const {var1: var2, var3: {var4: var5}} = {var1: 1, var3: {var4: 2}};"}, |
+ {"", "const {var1: var2, var3: [var4, var5]} = {var1: 1, var3: [2, 3]};"}, |
}; |
for (unsigned i = 0; i < arraysize(inners); ++i) { |