1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
=== tests/cases/compiler/declarationEmitDestructuringArrayPattern1.ts ===
var [] = [1, "hello"]; // Dont emit anything
var [x] = [1, "hello"]; // emit x: number
>x : Symbol(x, Decl(declarationEmitDestructuringArrayPattern1.ts, 1, 5))
var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string
>x1 : Symbol(x1, Decl(declarationEmitDestructuringArrayPattern1.ts, 2, 5))
>y1 : Symbol(y1, Decl(declarationEmitDestructuringArrayPattern1.ts, 2, 8))
var [, , z1] = [0, 1, 2]; // emit z1: number
>z1 : Symbol(z1, Decl(declarationEmitDestructuringArrayPattern1.ts, 3, 8))
var a = [1, "hello"];
>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 5, 3))
var [x2] = a; // emit x2: number | string
>x2 : Symbol(x2, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 5))
>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 5, 3))
var [x3, y3, z3] = a; // emit x3, y3, z3
>x3 : Symbol(x3, Decl(declarationEmitDestructuringArrayPattern1.ts, 7, 5))
>y3 : Symbol(y3, Decl(declarationEmitDestructuringArrayPattern1.ts, 7, 8))
>z3 : Symbol(z3, Decl(declarationEmitDestructuringArrayPattern1.ts, 7, 12))
>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 5, 3))
|