Update test cases

This commit is contained in:
Yui T 2015-03-24 10:11:29 -07:00
parent 6695981583
commit 1c2eae6b72
3 changed files with 10 additions and 31 deletions

View File

@ -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;

View File

@ -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[]

View File

@ -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] }) { }