Skip to content

Commit a46cb03

Browse files
committed
Add for-of test case
1 parent 125dd57 commit a46cb03

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

tests/baselines/reference/assignmentNestedInLiterals.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ target = [x = 1, y = x];
44

55
var aegis, a, b;
66
aegis = { x: a = 1, y: b = a };
7+
8+
var kowloona, c, d;
9+
for (kowloona of [c = 1, d = c]) {
10+
}
711

812

913
//// [assignmentNestedInLiterals.js]
1014
var target, x, y;
1115
target = [x = 1, y = x];
1216
var aegis, a, b;
1317
aegis = { x: a = 1, y: b = a };
18+
var kowloona, c, d;
19+
for (var _i = 0, _a = [c = 1, d = c]; _i < _a.length; _i++) {
20+
kowloona = _a[_i];
21+
}

tests/baselines/reference/assignmentNestedInLiterals.symbols

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,15 @@ aegis = { x: a = 1, y: b = a };
2323
>b : Symbol(b, Decl(assignmentNestedInLiterals.ts, 3, 13))
2424
>a : Symbol(a, Decl(assignmentNestedInLiterals.ts, 3, 10))
2525

26+
var kowloona, c, d;
27+
>kowloona : Symbol(kowloona, Decl(assignmentNestedInLiterals.ts, 6, 3))
28+
>c : Symbol(c, Decl(assignmentNestedInLiterals.ts, 6, 13))
29+
>d : Symbol(d, Decl(assignmentNestedInLiterals.ts, 6, 16))
30+
31+
for (kowloona of [c = 1, d = c]) {
32+
>kowloona : Symbol(kowloona, Decl(assignmentNestedInLiterals.ts, 6, 3))
33+
>c : Symbol(c, Decl(assignmentNestedInLiterals.ts, 6, 13))
34+
>d : Symbol(d, Decl(assignmentNestedInLiterals.ts, 6, 16))
35+
>c : Symbol(c, Decl(assignmentNestedInLiterals.ts, 6, 13))
36+
}
37+

tests/baselines/reference/assignmentNestedInLiterals.types

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,19 @@ aegis = { x: a = 1, y: b = a };
3333
>b : any
3434
>a : number
3535

36+
var kowloona, c, d;
37+
>kowloona : any
38+
>c : any
39+
>d : any
40+
41+
for (kowloona of [c = 1, d = c]) {
42+
>kowloona : any
43+
>[c = 1, d = c] : number[]
44+
>c = 1 : 1
45+
>c : any
46+
>1 : 1
47+
>d = c : number
48+
>d : any
49+
>c : number
50+
}
51+

tests/cases/compiler/assignmentNestedInLiterals.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ target = [x = 1, y = x];
44

55
var aegis, a, b;
66
aegis = { x: a = 1, y: b = a };
7+
8+
var kowloona, c, d;
9+
for (kowloona of [c = 1, d = c]) {
10+
}

0 commit comments

Comments
 (0)