Skip to content

Commit 1c2eae6

Browse files
author
Yui T
committed
Update test cases
1 parent 6695981 commit 1c2eae6

File tree

3 files changed

+10
-31
lines changed

3 files changed

+10
-31
lines changed

tests/baselines/reference/declarationEmitDestructuring4.js

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
//// [declarationEmitDestructuring4.ts]
2+
// For an array binding pattern with empty elements,
3+
// we will not make any modification and will emit
4+
// the similar binding pattern users' have written
25
function baz([]) { }
36
function baz1([] = [1,2,3]) { }
47
function baz2([[]] = [[1,2,3]]) { }
8+
59
function baz3({}) { }
610
function baz4({} = { x: 10 }) { }
7-
function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { }
811

912

1013

1114
//// [declarationEmitDestructuring4.js]
15+
// For an array binding pattern with empty elements,
16+
// we will not make any modification and will emit
17+
// the similar binding pattern users' have written
1218
function baz(_a) {
1319
var ;
1420
}
@@ -36,18 +42,6 @@ function baz4(_a) {
3642
x: 10
3743
} : _a;
3844
}
39-
function baz5(_a) {
40-
var _b = _a === void 0 ? {
41-
x: 10,
42-
y: {
43-
a: 2
44-
},
45-
z: [
46-
1,
47-
2
48-
]
49-
} : _a;
50-
}
5145

5246

5347
//// [declarationEmitDestructuring4.d.ts]
@@ -58,10 +52,3 @@ declare function baz3({}: {}): void;
5852
declare function baz4({}?: {
5953
x: number;
6054
}): void;
61-
declare function baz5({}?: {
62-
x: number;
63-
y: {
64-
a: number;
65-
};
66-
z: number[];
67-
}): void;

tests/baselines/reference/declarationEmitDestructuring4.types

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
=== tests/cases/compiler/declarationEmitDestructuring4.ts ===
2+
// For an array binding pattern with empty elements,
3+
// we will not make any modification and will emit
4+
// the similar binding pattern users' have written
25
function baz([]) { }
36
>baz : ([]: any[]) => void
47

@@ -19,14 +22,4 @@ function baz4({} = { x: 10 }) { }
1922
>{ x: 10 } : { x: number; }
2023
>x : number
2124

22-
function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { }
23-
>baz5 : ({}?: { x: number; y: { a: number; }; z: number[]; }) => void
24-
>{ x: 10, y: { a: 2 }, z: [1,2] } : { x: number; y: { a: number; }; z: number[]; }
25-
>x : number
26-
>y : { a: number; }
27-
>{ a: 2 } : { a: number; }
28-
>a : number
29-
>z : number[]
30-
>[1,2] : number[]
31-
3225

tests/cases/compiler/declarationEmitDestructuring4.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ function baz2([[]] = [[1,2,3]]) { }
88

99
function baz3({}) { }
1010
function baz4({} = { x: 10 }) { }
11-
function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { }
1211

0 commit comments

Comments
 (0)