33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
=== tests/cases/compiler/declarationEmitDestructuring4.ts ===
|
|
// For an array binding pattern with empty elements,
|
|
// we will not make any modification and will emit
|
|
// the similar binding pattern users' have written
|
|
function baz([]) { }
|
|
>baz : ([]: any[]) => void, Symbol(baz, Decl(declarationEmitDestructuring4.ts, 0, 0))
|
|
|
|
function baz1([] = [1,2,3]) { }
|
|
>baz1 : ([]?: number[]) => void, Symbol(baz1, Decl(declarationEmitDestructuring4.ts, 3, 20))
|
|
>[1,2,3] : number[]
|
|
>1 : number
|
|
>2 : number
|
|
>3 : number
|
|
|
|
function baz2([[]] = [[1,2,3]]) { }
|
|
>baz2 : ([[]]?: [number[]]) => void, Symbol(baz2, Decl(declarationEmitDestructuring4.ts, 4, 31))
|
|
>[[1,2,3]] : [number[]]
|
|
>[1,2,3] : number[]
|
|
>1 : number
|
|
>2 : number
|
|
>3 : number
|
|
|
|
function baz3({}) { }
|
|
>baz3 : ({}: {}) => void, Symbol(baz3, Decl(declarationEmitDestructuring4.ts, 5, 35))
|
|
|
|
function baz4({} = { x: 10 }) { }
|
|
>baz4 : ({}?: { x: number; }) => void, Symbol(baz4, Decl(declarationEmitDestructuring4.ts, 7, 21))
|
|
>{ x: 10 } : { x: number; }
|
|
>x : number, Symbol(x, Decl(declarationEmitDestructuring4.ts, 8, 20))
|
|
>10 : number
|
|
|
|
|