Merge pull request #3434 from Microsoft/port-3433

Port PR 3433 into release 1.5
This commit is contained in:
Vladimir Matveev 2015-06-11 14:24:29 -07:00
commit 1f587069da
6 changed files with 77 additions and 2 deletions

View file

@ -5327,10 +5327,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
emitSetters(exportStarFunction);
writeLine();
emitExecute(node, startIndex);
emitTempDeclarations(/*newLine*/ true)
decreaseIndent();
writeLine();
write("}"); // return
emitTempDeclarations(/*newLine*/ true);
}
function emitSetters(exportStarFunction: string) {

View file

@ -0,0 +1,21 @@
//// [systemModule13.ts]
export let [x,y,z] = [1, 2, 3];
export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}};
for ([x] of [[1]]) {}
//// [systemModule13.js]
System.register([], function(exports_1) {
var x, y, z, z0, z1;
return {
setters:[],
execute: function() {
_a = [1, 2, 3], exports_1("x", x = _a[0]), exports_1("y", y = _a[1]), exports_1("z", z = _a[2]);
_b = { a: true, b: { c: "123" } }, exports_1("z0", z0 = _b.a), exports_1("z1", z1 = _b.b.c);
for (var _i = 0, _c = [[1]]; _i < _c.length; _i++) {
exports_1("x", x = _c[_i][0]);
}
}
}
var _a, _b;
});

View file

@ -0,0 +1,17 @@
=== tests/cases/compiler/systemModule13.ts ===
export let [x,y,z] = [1, 2, 3];
>x : Symbol(x, Decl(systemModule13.ts, 1, 12))
>y : Symbol(y, Decl(systemModule13.ts, 1, 14))
>z : Symbol(z, Decl(systemModule13.ts, 1, 16))
export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}};
>z0 : Symbol(z0, Decl(systemModule13.ts, 2, 14))
>z1 : Symbol(z1, Decl(systemModule13.ts, 2, 25))
>a : Symbol(a, Decl(systemModule13.ts, 2, 36))
>b : Symbol(b, Decl(systemModule13.ts, 2, 44))
>c : Symbol(c, Decl(systemModule13.ts, 2, 49))
for ([x] of [[1]]) {}
>x : Symbol(x, Decl(systemModule13.ts, 1, 12))

View file

@ -0,0 +1,32 @@
=== tests/cases/compiler/systemModule13.ts ===
export let [x,y,z] = [1, 2, 3];
>x : number
>y : number
>z : number
>[1, 2, 3] : [number, number, number]
>1 : number
>2 : number
>3 : number
export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}};
>a : any
>z0 : boolean
>b : any
>c : any
>z1 : string
>{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; }
>a : boolean
>true : boolean
>b : { c: string; }
>{c: "123"} : { c: string; }
>c : string
>"123" : string
for ([x] of [[1]]) {}
>[x] : number[]
>x : number
>[[1]] : number[][]
>[1] : number[]
>1 : number

View file

@ -66,6 +66,6 @@ System.register([], function(exports_1) {
exports_1("x", x = _b[_i][0]);
}
}
var _a;
}
var _a;
});

View file

@ -0,0 +1,5 @@
// @module: system
export let [x,y,z] = [1, 2, 3];
export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}};
for ([x] of [[1]]) {}