Skip to content

Port PR 3433 into release 1.5 #3434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon


function emitSetters(exportStarFunction: string) {
Expand Down
21 changes: 21 additions & 0 deletions tests/baselines/reference/systemModule13.js
Original file line number Diff line number Diff line change
@@ -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;
});
17 changes: 17 additions & 0 deletions tests/baselines/reference/systemModule13.symbols
Original file line number Diff line number Diff line change
@@ -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))

32 changes: 32 additions & 0 deletions tests/baselines/reference/systemModule13.types
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion tests/baselines/reference/systemModule8.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ System.register([], function(exports_1) {
exports_1("x", x = _b[_i][0]);
}
}
var _a;
}
var _a;
});
5 changes: 5 additions & 0 deletions tests/cases/compiler/systemModule13.ts
Original file line number Diff line number Diff line change
@@ -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]]) {}