Skip to content

Commit 4efa61c

Browse files
committed
More tests for binding elements referencing previous elements
1 parent 72a1e85 commit 4efa61c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
const [a, b = a] = [1]; // ok
2-
const [a, b = a, c = c] = [1]; // error for c
3-
const [a, b = a, c = d, d = a] = [1]; // error for c
2+
const [c, d = c, e = e] = [1]; // error for e = e
3+
const [f, g = f, h = i, i = f] = [1]; // error for h = i
44

5+
(function ([a, b = a]) { // ok
6+
})([1]);
7+
(function ([c, d = c, e = e]) { // error for e = e
8+
})([1]);
9+
(function ([f, g = f, h = i, i = f]) { // error for h = i
10+
})([1])
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const {
2+
a = 1,
3+
b = 2,
4+
c = b, // ok
5+
d = a, // ok
6+
e = f, // error
7+
f = f // error
8+
} = { } as any;

0 commit comments

Comments
 (0)