Change test files name

This commit is contained in:
Yui T 2015-03-23 17:58:53 -07:00
parent 5979dacf4f
commit 85624c0321
14 changed files with 147 additions and 32 deletions

View File

@ -1,11 +1,11 @@
//// [declarationEmitDestructuringArrayPattern5.ts]
//// [declarationEmitDestructuring1.ts]
function foo([a, b, c]: [string, string, string]): void { }
function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { }
function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { }
function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { }
//// [declarationEmitDestructuringArrayPattern5.js]
//// [declarationEmitDestructuring1.js]
function foo(_a) {
var a = _a[0], b = _a[1], c = _a[2];
}
@ -20,7 +20,7 @@ function baz(_a) {
}
//// [declarationEmitDestructuringArrayPattern5.d.ts]
//// [declarationEmitDestructuring1.d.ts]
declare function foo([a, b, c]: [string, string, string]): void;
declare function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void;
declare function bar({a1, b1, c1}: {

View File

@ -1,4 +1,4 @@
=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts ===
=== tests/cases/compiler/declarationEmitDestructuring1.ts ===
function foo([a, b, c]: [string, string, string]): void { }
>foo : ([a, b, c]: [string, string, string]) => void
>a : string

View File

@ -1,10 +1,10 @@
//// [declarationEmitDestructuringArrayPattern6.ts]
//// [declarationEmitDestructuring2.ts]
function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { }
function g([a, b, c, d] = [1, 2, 3, 4]) { }
function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ }
function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ }
//// [declarationEmitDestructuringArrayPattern6.js]
//// [declarationEmitDestructuring2.js]
function f(_a) {
var _b = _a === void 0 ? {
x: 10,
@ -41,7 +41,7 @@ function h1(_a) {
}
//// [declarationEmitDestructuringArrayPattern6.d.ts]
//// [declarationEmitDestructuring2.d.ts]
declare function f({x, y: [a, b, c, d]}?: {
x: number;
y: [number, number, number, number];

View File

@ -1,4 +1,4 @@
=== tests/cases/compiler/declarationEmitDestructuringArrayPattern6.ts ===
=== tests/cases/compiler/declarationEmitDestructuring2.ts ===
function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { }
>f : ({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]}?: { x: number; y: [number, number, number, number]; }) => void
>x : number

View File

@ -0,0 +1,22 @@
//// [declarationEmitDestructuring3.ts]
function bar([x, z, ...w]) { }
function foo([x, ...y] = [1, "string", true]) { }
//// [declarationEmitDestructuring3.js]
function bar(_a) {
var x = _a[0], z = _a[1], w = _a.slice(2);
}
function foo(_a) {
var _b = _a === void 0 ? [
1,
"string",
true
] : _a, x = _b[0], y = _b.slice(1);
}
//// [declarationEmitDestructuring3.d.ts]
declare function bar([x, z, ...w]: any[]): void;
declare function foo([x, ...y]?: (string | number | boolean)[]): void;

View File

@ -1,4 +1,4 @@
=== tests/cases/compiler/declarationEmitDestructuringArrayPattern7.ts ===
=== tests/cases/compiler/declarationEmitDestructuring3.ts ===
function bar([x, z, ...w]) { }
>bar : ([x, z, ...w]: any[]) => void
>x : any
@ -11,3 +11,4 @@ function foo([x, ...y] = [1, "string", true]) { }
>y : (string | number | boolean)[]
>[1, "string", true] : (string | number | boolean)[]

View File

@ -0,0 +1,67 @@
//// [declarationEmitDestructuring4.ts]
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]
function baz(_a) {
var ;
}
function baz1(_a) {
var _b = _a === void 0 ? [
1,
2,
3
] : _a;
}
function baz2(_a) {
var _b = (_a === void 0 ? [
[
1,
2,
3
]
] : _a)[0];
}
function baz3(_a) {
var ;
}
function baz4(_a) {
var _b = _a === void 0 ? {
x: 10
} : _a;
}
function baz5(_a) {
var _b = _a === void 0 ? {
x: 10,
y: {
a: 2
},
z: [
1,
2
]
} : _a;
}
//// [declarationEmitDestructuring4.d.ts]
declare function baz([]: any[]): void;
declare function baz1([]?: number[]): void;
declare function baz2([[]]?: [number[]]): void;
declare function baz3({}: {}): void;
declare function baz4({}?: {
x: number;
}): void;
declare function baz5({}?: {
x: number;
y: {
a: number;
};
z: number[];
}): void;

View File

@ -0,0 +1,32 @@
=== tests/cases/compiler/declarationEmitDestructuring4.ts ===
function baz([]) { }
>baz : ([]: any[]) => void
function baz1([] = [1,2,3]) { }
>baz1 : ([]?: number[]) => void
>[1,2,3] : number[]
function baz2([[]] = [[1,2,3]]) { }
>baz2 : ([[]]?: [number[]]) => void
>[[1,2,3]] : [number[]]
>[1,2,3] : number[]
function baz3({}) { }
>baz3 : ({}: {}) => void
function baz4({} = { x: 10 }) { }
>baz4 : ({}?: { x: number; }) => void
>{ 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

@ -1,20 +0,0 @@
//// [declarationEmitDestructuringArrayPattern7.ts]
function bar([x, z, ...w]) { }
function foo([x, ...y] = [1, "string", true]) { }
//// [declarationEmitDestructuringArrayPattern7.js]
function bar(_a) {
var x = _a[0], z = _a[1], w = _a.slice(2);
}
function foo(_a) {
var _b = _a === void 0 ? [
1,
"string",
true
] : _a, x = _b[0], y = _b.slice(1);
}
//// [declarationEmitDestructuringArrayPattern7.d.ts]
declare function bar([x, z, w]: any[]): void;
declare function foo([x, y]?: (string | number | boolean)[]): void;

View File

@ -0,0 +1,4 @@
// @declaration: true
function bar([x, z, ...w]) { }
function foo([x, ...y] = [1, "string", true]) { }

View File

@ -0,0 +1,12 @@
// @declaration: true
// 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] }) { }

View File

@ -1,3 +0,0 @@
// @declaration: true
function bar([x, z, ...w]) { }
function foo([x, ...y] = [1, "string", true]) { }