33 lines
747 B
Plaintext
33 lines
747 B
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
|
|
|
|
function baz1([] = [1,2,3]) { }
|
|
>baz1 : ([]?: number[]) => void
|
|
>[1,2,3] : number[]
|
|
>1 : number
|
|
>2 : number
|
|
>3 : number
|
|
|
|
function baz2([[]] = [[1,2,3]]) { }
|
|
>baz2 : ([[]]?: [number[]]) => void
|
|
>[[1,2,3]] : [number[]]
|
|
>[1,2,3] : number[]
|
|
>1 : number
|
|
>2 : number
|
|
>3 : number
|
|
|
|
function baz3({}) { }
|
|
>baz3 : ({}: {}) => void
|
|
|
|
function baz4({} = { x: 10 }) { }
|
|
>baz4 : ({}?: { x: number; }) => void
|
|
>{ x: 10 } : { x: number; }
|
|
>x : number
|
|
>10 : number
|
|
|
|
|