Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a95c423

Browse filesBrowse files
committed
Revising test
1 parent d5ff9ee commit a95c423
Copy full SHA for a95c423

4 files changed

+75-25Lines changed: 75 additions & 25 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/baselines/reference/destructuringWithLiteralInitializers.js‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/destructuringWithLiteralInitializers.js
+17-6Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,20 @@ g1([1, 1]);
5050
function g2([x = 0, y = 0]) { }
5151
g2([1, 1]);
5252

53-
// (arg?: [any, any]) => void
54-
function g3([x, y] = []) { }
53+
// (arg?: [number, number]) => void
54+
function g3([x, y] = [0, 0]) { }
5555
g3();
5656
g3([1, 1]);
5757

5858
// (arg?: [number, number]) => void
59-
function g4([x, y] = [0, 0]) { }
59+
function g4([x, y = 0] = [0]) { }
6060
g4();
6161
g4([1, 1]);
62+
63+
// (arg?: [number, number]) => void
64+
function g5([x = 0, y = 0] = []) { }
65+
g5();
66+
g5([1, 1]);
6267

6368

6469
//// [destructuringWithLiteralInitializers.js]
@@ -122,15 +127,21 @@ function g2(_a) {
122127
var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 0 : _c;
123128
}
124129
g2([1, 1]);
125-
// (arg?: [any, any]) => void
130+
// (arg?: [number, number]) => void
126131
function g3(_a) {
127-
var _b = _a === void 0 ? [] : _a, x = _b[0], y = _b[1];
132+
var _b = _a === void 0 ? [0, 0] : _a, x = _b[0], y = _b[1];
128133
}
129134
g3();
130135
g3([1, 1]);
131136
// (arg?: [number, number]) => void
132137
function g4(_a) {
133-
var _b = _a === void 0 ? [0, 0] : _a, x = _b[0], y = _b[1];
138+
var _b = _a === void 0 ? [0] : _a, x = _b[0], _c = _b[1], y = _c === void 0 ? 0 : _c;
134139
}
135140
g4();
136141
g4([1, 1]);
142+
// (arg?: [number, number]) => void
143+
function g5(_a) {
144+
var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 0 : _d;
145+
}
146+
g5();
147+
g5([1, 1]);
Collapse file

‎tests/baselines/reference/destructuringWithLiteralInitializers.symbols‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/destructuringWithLiteralInitializers.symbols
+15-3Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ function g2([x = 0, y = 0]) { }
156156
g2([1, 1]);
157157
>g2 : Symbol(g2, Decl(destructuringWithLiteralInitializers.ts, 45, 11))
158158

159-
// (arg?: [any, any]) => void
160-
function g3([x, y] = []) { }
159+
// (arg?: [number, number]) => void
160+
function g3([x, y] = [0, 0]) { }
161161
>g3 : Symbol(g3, Decl(destructuringWithLiteralInitializers.ts, 49, 11))
162162
>x : Symbol(x, Decl(destructuringWithLiteralInitializers.ts, 52, 13))
163163
>y : Symbol(y, Decl(destructuringWithLiteralInitializers.ts, 52, 15))
@@ -169,7 +169,7 @@ g3([1, 1]);
169169
>g3 : Symbol(g3, Decl(destructuringWithLiteralInitializers.ts, 49, 11))
170170

171171
// (arg?: [number, number]) => void
172-
function g4([x, y] = [0, 0]) { }
172+
function g4([x, y = 0] = [0]) { }
173173
>g4 : Symbol(g4, Decl(destructuringWithLiteralInitializers.ts, 54, 11))
174174
>x : Symbol(x, Decl(destructuringWithLiteralInitializers.ts, 57, 13))
175175
>y : Symbol(y, Decl(destructuringWithLiteralInitializers.ts, 57, 15))
@@ -180,3 +180,15 @@ g4();
180180
g4([1, 1]);
181181
>g4 : Symbol(g4, Decl(destructuringWithLiteralInitializers.ts, 54, 11))
182182

183+
// (arg?: [number, number]) => void
184+
function g5([x = 0, y = 0] = []) { }
185+
>g5 : Symbol(g5, Decl(destructuringWithLiteralInitializers.ts, 59, 11))
186+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers.ts, 62, 13))
187+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers.ts, 62, 19))
188+
189+
g5();
190+
>g5 : Symbol(g5, Decl(destructuringWithLiteralInitializers.ts, 59, 11))
191+
192+
g5([1, 1]);
193+
>g5 : Symbol(g5, Decl(destructuringWithLiteralInitializers.ts, 59, 11))
194+
Collapse file

‎tests/baselines/reference/destructuringWithLiteralInitializers.types‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/destructuringWithLiteralInitializers.types
+35-13Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,40 +248,62 @@ g2([1, 1]);
248248
>1 : number
249249
>1 : number
250250

251-
// (arg?: [any, any]) => void
252-
function g3([x, y] = []) { }
253-
>g3 : ([x, y]?: [any, any]) => void
254-
>x : any
255-
>y : any
256-
>[] : [undefined, undefined]
251+
// (arg?: [number, number]) => void
252+
function g3([x, y] = [0, 0]) { }
253+
>g3 : ([x, y]?: [number, number]) => void
254+
>x : number
255+
>y : number
256+
>[0, 0] : [number, number]
257+
>0 : number
258+
>0 : number
257259

258260
g3();
259261
>g3() : void
260-
>g3 : ([x, y]?: [any, any]) => void
262+
>g3 : ([x, y]?: [number, number]) => void
261263

262264
g3([1, 1]);
263265
>g3([1, 1]) : void
264-
>g3 : ([x, y]?: [any, any]) => void
266+
>g3 : ([x, y]?: [number, number]) => void
265267
>[1, 1] : [number, number]
266268
>1 : number
267269
>1 : number
268270

269271
// (arg?: [number, number]) => void
270-
function g4([x, y] = [0, 0]) { }
271-
>g4 : ([x, y]?: [number, number]) => void
272+
function g4([x, y = 0] = [0]) { }
273+
>g4 : ([x, y = 0]?: [number, number]) => void
272274
>x : number
273275
>y : number
274-
>[0, 0] : [number, number]
275276
>0 : number
277+
>[0] : [number, number]
276278
>0 : number
277279

278280
g4();
279281
>g4() : void
280-
>g4 : ([x, y]?: [number, number]) => void
282+
>g4 : ([x, y = 0]?: [number, number]) => void
281283

282284
g4([1, 1]);
283285
>g4([1, 1]) : void
284-
>g4 : ([x, y]?: [number, number]) => void
286+
>g4 : ([x, y = 0]?: [number, number]) => void
287+
>[1, 1] : [number, number]
288+
>1 : number
289+
>1 : number
290+
291+
// (arg?: [number, number]) => void
292+
function g5([x = 0, y = 0] = []) { }
293+
>g5 : ([x = 0, y = 0]?: [number, number]) => void
294+
>x : number
295+
>0 : number
296+
>y : number
297+
>0 : number
298+
>[] : [number, number]
299+
300+
g5();
301+
>g5() : void
302+
>g5 : ([x = 0, y = 0]?: [number, number]) => void
303+
304+
g5([1, 1]);
305+
>g5([1, 1]) : void
306+
>g5 : ([x = 0, y = 0]?: [number, number]) => void
285307
>[1, 1] : [number, number]
286308
>1 : number
287309
>1 : number
Collapse file

‎tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers.ts‎

Copy file name to clipboardExpand all lines: tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers.ts
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,17 @@ g1([1, 1]);
4949
function g2([x = 0, y = 0]) { }
5050
g2([1, 1]);
5151

52-
// (arg?: [any, any]) => void
53-
function g3([x, y] = []) { }
52+
// (arg?: [number, number]) => void
53+
function g3([x, y] = [0, 0]) { }
5454
g3();
5555
g3([1, 1]);
5656

5757
// (arg?: [number, number]) => void
58-
function g4([x, y] = [0, 0]) { }
58+
function g4([x, y = 0] = [0]) { }
5959
g4();
6060
g4([1, 1]);
61+
62+
// (arg?: [number, number]) => void
63+
function g5([x = 0, y = 0] = []) { }
64+
g5();
65+
g5([1, 1]);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.