-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
Milestone
Description
TypeScript Version: 2.0
Code
// source ts code
let i = 1000;
while (i--) {
let [a, b, c] = [1, 2, 3];
}Expected behavior:
// compiled by babel
var i = 1000;
while (i--) {
var a = 1;
var b = 2;
var c = 3;
}Actual behavior:
// compiled by tsc
var i = 1000;
while (i--) {
var _a = [1, 2, 3], a = _a[0], b = _a[1], c = _a[2];
}On each iteration tsc creates new unnecessary array _a.
notary