diff --git a/tests/baselines/reference/declarationEmitDestructuring4.js b/tests/baselines/reference/declarationEmitDestructuring4.js index 5b43fbfc85e..81d1707b8e6 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.js +++ b/tests/baselines/reference/declarationEmitDestructuring4.js @@ -1,14 +1,20 @@ //// [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([]) { } function baz1([] = [1,2,3]) { } function baz2([[]] = [[1,2,3]]) { } + function baz3({}) { } function baz4({} = { x: 10 }) { } -function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } //// [declarationEmitDestructuring4.js] +// 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(_a) { var ; } @@ -36,18 +42,6 @@ function baz4(_a) { x: 10 } : _a; } -function baz5(_a) { - var _b = _a === void 0 ? { - x: 10, - y: { - a: 2 - }, - z: [ - 1, - 2 - ] - } : _a; -} //// [declarationEmitDestructuring4.d.ts] @@ -58,10 +52,3 @@ declare function baz3({}: {}): void; declare function baz4({}?: { x: number; }): void; -declare function baz5({}?: { - x: number; - y: { - a: number; - }; - z: number[]; -}): void; diff --git a/tests/baselines/reference/declarationEmitDestructuring4.types b/tests/baselines/reference/declarationEmitDestructuring4.types index 6602fbdcb77..6a90eda1702 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.types +++ b/tests/baselines/reference/declarationEmitDestructuring4.types @@ -1,4 +1,7 @@ === 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 @@ -19,14 +22,4 @@ function baz4({} = { x: 10 }) { } >{ x: 10 } : { x: number; } >x : number -function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { } ->baz5 : ({}?: { x: number; y: { a: number; }; z: number[]; }) => void ->{ x: 10, y: { a: 2 }, z: [1,2] } : { x: number; y: { a: number; }; z: number[]; } ->x : number ->y : { a: number; } ->{ a: 2 } : { a: number; } ->a : number ->z : number[] ->[1,2] : number[] - diff --git a/tests/cases/compiler/declarationEmitDestructuring4.ts b/tests/cases/compiler/declarationEmitDestructuring4.ts index b961be2b39c..bd1a57af12e 100644 --- a/tests/cases/compiler/declarationEmitDestructuring4.ts +++ b/tests/cases/compiler/declarationEmitDestructuring4.ts @@ -8,5 +8,4 @@ function baz2([[]] = [[1,2,3]]) { } function baz3({}) { } function baz4({} = { x: 10 }) { } -function baz5({} = { x: 10, y: { a: 2 }, z: [1,2] }) { }