Skip to content

Commit c9e2f95

Browse files
committed
Accept new baselines
1 parent e9858de commit c9e2f95

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

tests/baselines/reference/controlFlowArrays.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ function f15() {
146146
x.push("hello");
147147
}
148148
return x; // string[]
149+
}
150+
151+
function f16() {
152+
let x;
153+
let y;
154+
(x = [], x).push(5);
155+
(x.push("hello"), x).push(true);
156+
((x))[3] = { a: 1 };
157+
return x; // (string | number | boolean | { a: number })[]
149158
}
150159

151160
//// [controlFlowArrays.js]
@@ -282,3 +291,11 @@ function f15() {
282291
}
283292
return x; // string[]
284293
}
294+
function f16() {
295+
var x;
296+
var y;
297+
(x = [], x).push(5);
298+
(x.push("hello"), x).push(true);
299+
((x))[3] = { a: 1 };
300+
return x; // (string | number | boolean | { a: number })[]
301+
}

tests/baselines/reference/controlFlowArrays.symbols

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,34 @@ function f15() {
369369
return x; // string[]
370370
>x : Symbol(x, Decl(controlFlowArrays.ts, 141, 7))
371371
}
372+
373+
function f16() {
374+
>f16 : Symbol(f16, Decl(controlFlowArrays.ts, 147, 1))
375+
376+
let x;
377+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
378+
379+
let y;
380+
>y : Symbol(y, Decl(controlFlowArrays.ts, 151, 7))
381+
382+
(x = [], x).push(5);
383+
>(x = [], x).push : Symbol(Array.push, Decl(lib.d.ts, --, --))
384+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
385+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
386+
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
387+
388+
(x.push("hello"), x).push(true);
389+
>(x.push("hello"), x).push : Symbol(Array.push, Decl(lib.d.ts, --, --))
390+
>x.push : Symbol(Array.push, Decl(lib.d.ts, --, --))
391+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
392+
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
393+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
394+
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
395+
396+
((x))[3] = { a: 1 };
397+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
398+
>a : Symbol(a, Decl(controlFlowArrays.ts, 154, 16))
399+
400+
return x; // (string | number | boolean | { a: number })[]
401+
>x : Symbol(x, Decl(controlFlowArrays.ts, 150, 7))
402+
}

tests/baselines/reference/controlFlowArrays.types

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,53 @@ function f15() {
471471
return x; // string[]
472472
>x : string[]
473473
}
474+
475+
function f16() {
476+
>f16 : () => (string | number | boolean | { a: number; })[]
477+
478+
let x;
479+
>x : any
480+
481+
let y;
482+
>y : any
483+
484+
(x = [], x).push(5);
485+
>(x = [], x).push(5) : number
486+
>(x = [], x).push : (...items: any[]) => number
487+
>(x = [], x) : any[]
488+
>x = [], x : any[]
489+
>x = [] : never[]
490+
>x : any
491+
>[] : never[]
492+
>x : any[]
493+
>push : (...items: any[]) => number
494+
>5 : 5
495+
496+
(x.push("hello"), x).push(true);
497+
>(x.push("hello"), x).push(true) : number
498+
>(x.push("hello"), x).push : (...items: any[]) => number
499+
>(x.push("hello"), x) : any[]
500+
>x.push("hello"), x : any[]
501+
>x.push("hello") : number
502+
>x.push : (...items: any[]) => number
503+
>x : any[]
504+
>push : (...items: any[]) => number
505+
>"hello" : "hello"
506+
>x : any[]
507+
>push : (...items: any[]) => number
508+
>true : true
509+
510+
((x))[3] = { a: 1 };
511+
>((x))[3] = { a: 1 } : { a: number; }
512+
>((x))[3] : any
513+
>((x)) : any[]
514+
>(x) : any[]
515+
>x : any[]
516+
>3 : 3
517+
>{ a: 1 } : { a: number; }
518+
>a : number
519+
>1 : 1
520+
521+
return x; // (string | number | boolean | { a: number })[]
522+
>x : (string | number | boolean | { a: number; })[]
523+
}

0 commit comments

Comments
 (0)