mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Adding regression test
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//// [controlFlowDestructuringParameters.ts]
|
||||
// Repro for #8376
|
||||
|
||||
|
||||
[{ x: 1 }].map(
|
||||
({ x }) => x
|
||||
);
|
||||
|
||||
|
||||
//// [controlFlowDestructuringParameters.js]
|
||||
// Repro for #8376
|
||||
[{ x: 1 }].map(function (_a) {
|
||||
var x = _a.x;
|
||||
return x;
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/controlFlowDestructuringParameters.ts ===
|
||||
// Repro for #8376
|
||||
|
||||
|
||||
[{ x: 1 }].map(
|
||||
>[{ x: 1 }].map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
>x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 3, 2))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --))
|
||||
|
||||
({ x }) => x
|
||||
>x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 4, 4))
|
||||
>x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 4, 4))
|
||||
|
||||
);
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/compiler/controlFlowDestructuringParameters.ts ===
|
||||
// Repro for #8376
|
||||
|
||||
|
||||
[{ x: 1 }].map(
|
||||
>[{ x: 1 }].map( ({ x }) => x) : number[]
|
||||
>[{ x: 1 }].map : <U>(callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[]
|
||||
>[{ x: 1 }] : { x: number; }[]
|
||||
>{ x: 1 } : { x: number; }
|
||||
>x : number
|
||||
>1 : number
|
||||
>map : <U>(callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[]
|
||||
|
||||
({ x }) => x
|
||||
>({ x }) => x : ({x}: { x: number; }) => number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// Repro for #8376
|
||||
|
||||
// @strictNullChecks: true
|
||||
|
||||
[{ x: 1 }].map(
|
||||
({ x }) => x
|
||||
);
|
||||
Reference in New Issue
Block a user