Merge pull request #5208 from Microsoft/capturedBlockScopedVars

support block scoped vars captured in closures inside loops
This commit is contained in:
Vladimir Matveev
2015-10-26 16:58:15 -07:00
79 changed files with 32073 additions and 65 deletions

View File

@@ -0,0 +1,272 @@
//// [capturedLetConstInLoop1.ts]
//==== let
for (let x in {}) {
(function() { return x});
(() => x);
}
for (let x of []) {
(function() { return x});
(() => x);
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
}
do {
let x;
(function() { return x});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
}
//=========const
for (const x in {}) {
(function() { return x});
(() => x);
}
for (const x of []) {
(function() { return x});
(() => x);
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
}
do {
const x = 1;
(function() { return x});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
}
//// [capturedLetConstInLoop1.js]
//==== let
var _loop_1 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x in {}) {
_loop_1(x);
}
var _loop_2 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
_loop_2(x);
}
var _loop_3 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x = 0; x < 1; ++x) {
_loop_3(x);
}
var _loop_4 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
};
while (1 === 1) {
_loop_4();
}
var _loop_5 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
};
do {
_loop_5();
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
};
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
var _loop_7 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1; ++x) {
_loop_7(x, y);
}
var _loop_8 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_8();
}
var _loop_9 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
};
do {
_loop_9();
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
};
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
//=========const
var _loop_11 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x in {}) {
_loop_11(x);
}
var _loop_12 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
_loop_12(x);
}
var _loop_13 = function(x) {
(function () { return x; });
(function () { return x; });
};
for (var x = 0; x < 1;) {
_loop_13(x);
}
var _loop_14 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
};
while (1 === 1) {
_loop_14();
}
var _loop_15 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
};
do {
_loop_15();
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
};
for (var y = 0; y < 1;) {
_loop_16(y);
}
var _loop_17 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1;) {
_loop_17(x, y);
}
var _loop_18 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_18();
}
var _loop_19 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
};
do {
_loop_19();
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
};
for (var y = 0; y < 1;) {
_loop_20(y);
}

View File

@@ -0,0 +1,260 @@
=== tests/cases/compiler/capturedLetConstInLoop1.ts ===
//==== let
for (let x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8))
}
//=========const
for (const x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10))
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 85, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 85, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10))
}

View File

@@ -0,0 +1,428 @@
=== tests/cases/compiler/capturedLetConstInLoop1.ts ===
//==== let
for (let x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//=========const
for (const x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}

View File

@@ -0,0 +1,210 @@
//// [capturedLetConstInLoop1_ES6.ts]
//==== let
for (let x in {}) {
(function() { return x});
(() => x);
}
for (let x of []) {
(function() { return x});
(() => x);
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
}
do {
let x;
(function() { return x});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
}
//=========const
for (const x in {}) {
(function() { return x});
(() => x);
}
for (const x of []) {
(function() { return x});
(() => x);
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
}
do {
const x = 1;
(function() { return x});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
}
//// [capturedLetConstInLoop1_ES6.js]
//==== let
for (let x in {}) {
(function () { return x; });
(() => x);
}
for (let x of []) {
(function () { return x; });
(() => x);
}
for (let x = 0; x < 1; ++x) {
(function () { return x; });
(() => x);
}
while (1 === 1) {
let x;
(function () { return x; });
(() => x);
}
do {
let x;
(function () { return x; });
(() => x);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x; });
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
(function () { return x + y; });
(() => x + y);
}
while (1 === 1) {
let x, y;
(function () { return x + y; });
(() => x + y);
}
do {
let x, y;
(function () { return x + y; });
(() => x + y);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x + y; });
(() => x + y);
}
//=========const
for (const x in {}) {
(function () { return x; });
(() => x);
}
for (const x of []) {
(function () { return x; });
(() => x);
}
for (const x = 0; x < 1;) {
(function () { return x; });
(() => x);
}
while (1 === 1) {
const x = 1;
(function () { return x; });
(() => x);
}
do {
const x = 1;
(function () { return x; });
(() => x);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x; });
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
(function () { return x + y; });
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
}
do {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x + y; });
(() => x + y);
}

View File

@@ -0,0 +1,260 @@
=== tests/cases/compiler/capturedLetConstInLoop1_ES6.ts ===
//==== let
for (let x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 1, 8))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 6, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 6, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 6, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 11, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 17, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 17, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 17, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 23, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 23, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 23, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 28, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 28, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 29, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 29, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 29, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 34, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 34, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 34, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 34, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 40, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 40, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 40, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 40, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 46, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 46, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 46, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 46, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 52, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 51, 8))
}
//=========const
for (const x in {}) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 58, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 58, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 58, 10))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 63, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 63, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 63, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 68, 10))
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 74, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 74, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 74, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 80, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 80, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 80, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 85, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 85, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 86, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 86, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 86, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 91, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 91, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 91, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 91, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 97, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 97, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 97, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 97, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 103, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 103, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 103, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 103, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 109, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop1_ES6.ts, 109, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop1_ES6.ts, 108, 10))
}

View File

@@ -0,0 +1,428 @@
=== tests/cases/compiler/capturedLetConstInLoop1_ES6.ts ===
//==== let
for (let x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//=========const
for (const x in {}) {
>x : any
>{} : {}
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}

View File

@@ -0,0 +1,413 @@
//// [capturedLetConstInLoop2.ts]
// ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2(x) {
while (1 === 1) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3(x) {
do {
let x;
let a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
let a = arguments.length;
let x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6(x) {
while (1 === 1) {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7(x) {
do {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
///=======const
function foo0_c(x) {
for (const x of []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1_c(x) {
for (const x in []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2_c(x) {
while (1 === 1) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3_c(x) {
do {
const x = 1;
const a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
const a = arguments.length;
const x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y =1 ;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7_c(x) {
do {
const x = 1, y = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
//// [capturedLetConstInLoop2.js]
// ========let
function foo0(x) {
var _loop_1 = function(x_1) {
var a = arguments_1.length;
(function () { return x_1 + a; });
(function () { return x_1 + a; });
};
var arguments_1 = arguments;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_1 = _a[_i];
_loop_1(x_1);
}
}
function foo0_1(x) {
var _loop_2 = function(x_2) {
var a = arguments_2.length;
(function () { return x_2 + a; });
(function () { return x_2 + a; });
};
var arguments_2 = arguments;
for (var x_2 in []) {
_loop_2(x_2);
}
}
function foo1(x) {
var _loop_3 = function(x_3) {
var a = arguments_3.length;
(function () { return x_3 + a; });
(function () { return x_3 + a; });
};
var arguments_3 = arguments;
for (var x_3 = 0; x_3 < 1; ++x_3) {
_loop_3(x_3);
}
}
function foo2(x) {
var _loop_4 = function() {
var a = arguments_4.length;
(function () { return x + a; });
(function () { return x + a; });
};
var arguments_4 = arguments;
while (1 === 1) {
_loop_4();
}
}
function foo3(x) {
var _loop_5 = function() {
var x_4 = void 0;
var a = arguments_5.length;
(function () { return x_4 + a; });
(function () { return x_4 + a; });
};
var arguments_5 = arguments;
do {
_loop_5();
} while (1 === 1);
}
function foo4(x) {
var _loop_6 = function(y) {
var a = arguments_6.length;
var x_5 = 1;
(function () { return x_5 + a; });
(function () { return x_5 + a; });
};
var arguments_6 = arguments;
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
}
function foo5(x) {
var _loop_7 = function(x_6, y) {
var a = arguments_7.length;
(function () { return x_6 + y + a; });
(function () { return x_6 + y + a; });
};
var arguments_7 = arguments;
for (var x_6 = 0, y = 1; x_6 < 1; ++x_6) {
_loop_7(x_6, y);
}
}
function foo6(x) {
var _loop_8 = function() {
var x_7 = void 0, y = void 0;
var a = arguments_8.length;
(function () { return x_7 + y + a; });
(function () { return x_7 + y + a; });
};
var arguments_8 = arguments;
while (1 === 1) {
_loop_8();
}
}
function foo7(x) {
var _loop_9 = function() {
var x_8 = void 0, y = void 0;
var a = arguments_9.length;
(function () { return x_8 + y + a; });
(function () { return x_8 + y + a; });
};
var arguments_9 = arguments;
do {
_loop_9();
} while (1 === 1);
}
function foo8(x) {
var _loop_10 = function(y) {
var x_9 = 1;
var a = arguments_10.length;
(function () { return x_9 + y + a; });
(function () { return x_9 + y + a; });
};
var arguments_10 = arguments;
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
}
///=======const
function foo0_c(x) {
var _loop_11 = function(x_10) {
var a = arguments_11.length;
(function () { return x_10 + a; });
(function () { return x_10 + a; });
};
var arguments_11 = arguments;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_10 = _a[_i];
_loop_11(x_10);
}
}
function foo0_1_c(x) {
var _loop_12 = function(x_11) {
var a = arguments_12.length;
(function () { return x_11 + a; });
(function () { return x_11 + a; });
};
var arguments_12 = arguments;
for (var x_11 in []) {
_loop_12(x_11);
}
}
function foo1_c(x) {
var _loop_13 = function(x_12) {
var a = arguments_13.length;
(function () { return x_12 + a; });
(function () { return x_12 + a; });
};
var arguments_13 = arguments;
for (var x_12 = 0; x_12 < 1;) {
_loop_13(x_12);
}
}
function foo2_c(x) {
var _loop_14 = function() {
var a = arguments_14.length;
(function () { return x + a; });
(function () { return x + a; });
};
var arguments_14 = arguments;
while (1 === 1) {
_loop_14();
}
}
function foo3_c(x) {
var _loop_15 = function() {
var x_13 = 1;
var a = arguments_15.length;
(function () { return x_13 + a; });
(function () { return x_13 + a; });
};
var arguments_15 = arguments;
do {
_loop_15();
} while (1 === 1);
}
function foo4_c(x) {
var _loop_16 = function(y) {
var a = arguments_16.length;
var x_14 = 1;
(function () { return x_14 + a; });
(function () { return x_14 + a; });
};
var arguments_16 = arguments;
for (var y = 0; y < 1;) {
_loop_16(y);
}
}
function foo5_c(x) {
var _loop_17 = function(x_15, y) {
var a = arguments_17.length;
(function () { return x_15 + y + a; });
(function () { return x_15 + y + a; });
};
var arguments_17 = arguments;
for (var x_15 = 0, y = 1; x_15 < 1;) {
_loop_17(x_15, y);
}
}
function foo6_c(x) {
var _loop_18 = function() {
var x_16 = 1, y = 1;
var a = arguments_18.length;
(function () { return x_16 + y + a; });
(function () { return x_16 + y + a; });
};
var arguments_18 = arguments;
while (1 === 1) {
_loop_18();
}
}
function foo7_c(x) {
var _loop_19 = function() {
var x_17 = 1, y = 1;
var a = arguments_19.length;
(function () { return x_17 + y + a; });
(function () { return x_17 + y + a; });
};
var arguments_19 = arguments;
do {
_loop_19();
} while (1 === 1);
}
function foo8_c(x) {
var _loop_20 = function(y) {
var x_18 = 1;
var a = arguments_20.length;
(function () { return x_18 + y + a; });
(function () { return x_18 + y + a; });
};
var arguments_20 = arguments;
for (var y = 0; y < 1;) {
_loop_20(y);
}
}

View File

@@ -0,0 +1,519 @@
=== tests/cases/compiler/capturedLetConstInLoop2.ts ===
// ========let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop2.ts, 0, 0))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 3, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 4, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 5, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 4, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 5, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 4, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 5, 11))
}
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop2.ts, 9, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 11, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 12, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 13, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 12, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 13, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 12, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 13, 11))
}
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop2.ts, 17, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 19, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 21, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 21, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 20, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 21, 11))
}
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop2.ts, 25, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 27, 14))
while (1 === 1) {
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 29, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 27, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 29, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 27, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 29, 11))
}
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop2.ts, 33, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 35, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 37, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 38, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 37, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 38, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 37, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 38, 11))
} while (1 === 1)
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop2.ts, 42, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 44, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 45, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 45, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 45, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 46, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 47, 11))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 47, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 46, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 47, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 46, 11))
}
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop2.ts, 51, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 53, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 54, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 55, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 54, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 55, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 54, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 54, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 55, 11))
}
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop2.ts, 59, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 62, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 64, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 64, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 65, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 64, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 64, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 65, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 64, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 64, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 65, 11))
}
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop2.ts, 69, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 71, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 73, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 74, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 73, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 74, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 73, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 74, 11))
} while (1 === 1)
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop2.ts, 78, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 81, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 83, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 84, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 83, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 84, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 83, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 82, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 84, 11))
}
}
///=======const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop2.ts, 88, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 90, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 91, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 92, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 91, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 92, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 91, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 92, 13))
}
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop2.ts, 96, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 98, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 99, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 100, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 99, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 100, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 99, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 100, 13))
}
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop2.ts, 104, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 106, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 108, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 108, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 107, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 108, 13))
}
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop2.ts, 112, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 114, 16))
while (1 === 1) {
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 116, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 114, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 116, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 114, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 116, 13))
}
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop2.ts, 120, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 122, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 124, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 125, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 124, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 125, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 124, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 125, 13))
} while (1 === 1)
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop2.ts, 129, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 131, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 132, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 132, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 133, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 134, 13))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 134, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 133, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 134, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 133, 13))
}
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop2.ts, 138, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 140, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 141, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 142, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 141, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 142, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 141, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 141, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 142, 13))
}
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop2.ts, 146, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 149, 16))
while (1 === 1) {
const x = 1, y =1 ;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 151, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 151, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 152, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 151, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 151, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 152, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 151, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 151, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 152, 13))
}
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop2.ts, 156, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 158, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 160, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 160, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 161, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 160, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 160, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 161, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 160, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 160, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 161, 13))
} while (1 === 1)
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop2.ts, 165, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 168, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 170, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 171, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 170, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 171, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2.ts, 170, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2.ts, 169, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2.ts, 171, 13))
}
}

View File

@@ -0,0 +1,726 @@
=== tests/cases/compiler/capturedLetConstInLoop2.ts ===
// ========let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
let x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
}
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
///=======const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
const x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y =1 ;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}

View File

@@ -0,0 +1,330 @@
//// [capturedLetConstInLoop2_ES6.ts]
// ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2(x) {
while (1 === 1) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3(x) {
do {
let x;
let a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
let a = arguments.length;
let x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6(x) {
while (1 === 1) {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7(x) {
do {
let x, y;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
let a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
///=======const
function foo0_c(x) {
for (const x of []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1_c(x) {
for (const x in []) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo2_c(x) {
while (1 === 1) {
const a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo3_c(x) {
do {
const x = 1;
const a = arguments.length;
(function() { return x + a });
(() => x + a);
} while (1 === 1)
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
const a = arguments.length;
const x = 1;
(function() { return x + a });
(() => x + a);
}
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y =1 ;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
function foo7_c(x) {
do {
const x = 1, y = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
} while (1 === 1)
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
const a = arguments.length;
(function() { return x + y + a });
(() => x + y + a);
}
}
//// [capturedLetConstInLoop2_ES6.js]
// ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo2(x) {
while (1 === 1) {
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo3(x) {
do {
let x;
let a = arguments.length;
(function () { return x + a; });
(() => x + a);
} while (1 === 1);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
let a = arguments.length;
let x = 1;
(function () { return x + a; });
(() => x + a);
}
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo6(x) {
while (1 === 1) {
let x, y;
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo7(x) {
do {
let x, y;
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
} while (1 === 1);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
let a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
///=======const
function foo0_c(x) {
for (const x of []) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo0_1_c(x) {
for (const x in []) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo2_c(x) {
while (1 === 1) {
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
}
}
function foo3_c(x) {
do {
const x = 1;
const a = arguments.length;
(function () { return x + a; });
(() => x + a);
} while (1 === 1);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
const a = arguments.length;
const x = 1;
(function () { return x + a; });
(() => x + a);
}
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}
function foo7_c(x) {
do {
const x = 1, y = 1;
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
} while (1 === 1);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
const a = arguments.length;
(function () { return x + y + a; });
(() => x + y + a);
}
}

View File

@@ -0,0 +1,518 @@
=== tests/cases/compiler/capturedLetConstInLoop2_ES6.ts ===
// ========let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop2_ES6.ts, 0, 0))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 2, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 3, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 4, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 3, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 4, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 3, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 4, 11))
}
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop2_ES6.ts, 8, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 10, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 11, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 12, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 11, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 12, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 11, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 12, 11))
}
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop2_ES6.ts, 16, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 18, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 20, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 20, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 19, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 20, 11))
}
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop2_ES6.ts, 24, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 26, 14))
while (1 === 1) {
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 28, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 26, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 28, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 26, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 28, 11))
}
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop2_ES6.ts, 32, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 34, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 37, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 37, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 37, 11))
} while (1 === 1)
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop2_ES6.ts, 41, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 43, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 44, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 44, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 44, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 46, 11))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 46, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 46, 11))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11))
}
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop2_ES6.ts, 50, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 52, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 53, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 54, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 53, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 54, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 53, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 53, 19))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 54, 11))
}
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop2_ES6.ts, 58, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 61, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 63, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 64, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 63, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 64, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 63, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 64, 11))
}
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop2_ES6.ts, 68, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 70, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 72, 14))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 73, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 72, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 73, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 72, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 73, 11))
} while (1 === 1)
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop2_ES6.ts, 77, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 80, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11))
let a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 83, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 83, 11))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 81, 12))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 83, 11))
}
}
///=======const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop2_ES6.ts, 87, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 89, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 90, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 91, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 90, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 91, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 90, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 91, 13))
}
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop2_ES6.ts, 95, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 97, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 98, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 99, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 98, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 99, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 98, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 99, 13))
}
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop2_ES6.ts, 103, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 105, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 107, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 107, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 106, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 107, 13))
}
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop2_ES6.ts, 111, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 113, 16))
while (1 === 1) {
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 115, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 113, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 115, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 113, 16))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 115, 13))
}
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop2_ES6.ts, 119, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 121, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 124, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 124, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 124, 13))
} while (1 === 1)
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop2_ES6.ts, 128, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 130, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 131, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 131, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 133, 13))
(function() { return x + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 133, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13))
(() => x + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 133, 13))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13))
}
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop2_ES6.ts, 137, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 139, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 140, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 141, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 140, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 141, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 140, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 140, 21))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 141, 13))
}
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop2_ES6.ts, 145, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 148, 16))
while (1 === 1) {
const x = 1, y =1 ;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 150, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 151, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 150, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 151, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 150, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 151, 13))
}
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop2_ES6.ts, 155, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 157, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 159, 20))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 160, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 159, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 160, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 159, 20))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 160, 13))
} while (1 === 1)
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop2_ES6.ts, 164, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 167, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13))
const a = arguments.length;
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 170, 13))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return x + y + a });
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 170, 13))
(() => x + y + a);
>x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop2_ES6.ts, 168, 14))
>a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 170, 13))
}
}

View File

@@ -0,0 +1,725 @@
=== tests/cases/compiler/capturedLetConstInLoop2_ES6.ts ===
// ========let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
let x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
}
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => any
>function() { return x + y + a } : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
(() => x + y + a);
>(() => x + y + a) : () => any
>() => x + y + a : () => any
>x + y + a : any
>x + y : any
>x : any
>y : any
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
let a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
///=======const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => any
>function() { return x + a } : () => any
>x + a : any
>x : any
>a : number
(() => x + a);
>(() => x + a) : () => any
>() => x + a : () => any
>x + a : any
>x : any
>a : number
}
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
const x = 1;
>x : number
>1 : number
(function() { return x + a });
>(function() { return x + a }) : () => number
>function() { return x + a } : () => number
>x + a : number
>x : number
>a : number
(() => x + a);
>(() => x + a) : () => number
>() => x + a : () => number
>x + a : number
>x : number
>a : number
}
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y =1 ;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
const a = arguments.length;
>a : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return x + y + a });
>(function() { return x + y + a }) : () => number
>function() { return x + y + a } : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
(() => x + y + a);
>(() => x + y + a) : () => number
>() => x + y + a : () => number
>x + y + a : number
>x + y : number
>x : number
>y : number
>a : number
}
}

View File

@@ -0,0 +1,473 @@
//// [capturedLetConstInLoop3.ts]
///=========let
declare function use(a: any);
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//===const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
const x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//// [capturedLetConstInLoop3.js]
function foo0(x) {
var _loop_1 = function(x_1) {
v = x_1;
(function () { return x_1 + v; });
(function () { return x_1 + v; });
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_1 = _a[_i];
_loop_1(x_1);
}
use(v);
}
function foo0_1(x) {
var _loop_2 = function(x_2) {
v = x_2;
(function () { return x_2 + v; });
(function () { return x_2 + v; });
};
var v;
for (var x_2 in []) {
_loop_2(x_2);
}
use(v);
}
function foo1(x) {
var _loop_3 = function(x_3) {
v = x_3;
(function () { return x_3 + v; });
(function () { return x_3 + v; });
};
var v;
for (var x_3 = 0; x_3 < 1; ++x_3) {
_loop_3(x_3);
}
use(v);
}
function foo2(x) {
var _loop_4 = function() {
var x_4 = 1;
v = x_4;
(function () { return x_4 + v; });
(function () { return x_4 + v; });
};
var v;
while (1 === 1) {
_loop_4();
}
use(v);
}
function foo3(x) {
var _loop_5 = function() {
var x_5 = void 0;
(function () { return x_5 + v; });
(function () { return x_5 + v; });
};
var v;
do {
_loop_5();
} while (1 === 1);
use(v);
}
function foo4(x) {
var _loop_6 = function(y) {
v = y;
var x_6 = 1;
(function () { return x_6 + v; });
(function () { return x_6 + v; });
};
var v;
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
use(v);
}
function foo5(x) {
var _loop_7 = function(x_7, y) {
v = x_7;
(function () { return x_7 + y + v; });
(function () { return x_7 + y + v; });
};
var v;
for (var x_7 = 0, y = 1; x_7 < 1; ++x_7) {
_loop_7(x_7, y);
}
use(v);
}
function foo6(x) {
var _loop_8 = function() {
var x_8 = void 0, y = void 0;
v = x_8;
(function () { return x_8 + y + v; });
(function () { return x_8 + y + v; });
};
var v;
while (1 === 1) {
_loop_8();
}
use(v);
}
function foo7(x) {
var _loop_9 = function() {
var x_9 = void 0, y = void 0;
v = x_9;
(function () { return x_9 + y + v; });
(function () { return x_9 + y + v; });
};
var v;
do {
_loop_9();
} while (1 === 1);
use(v);
}
function foo8(x) {
var _loop_10 = function(y) {
var x_10 = 1;
v = x_10;
(function () { return x_10 + y + v; });
(function () { return x_10 + y + v; });
};
var v;
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
use(v);
}
//===const
function foo0_c(x) {
var _loop_11 = function(x_11) {
v = x_11;
(function () { return x_11 + v; });
(function () { return x_11 + v; });
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_11 = _a[_i];
_loop_11(x_11);
}
use(v);
}
function foo0_1_c(x) {
var _loop_12 = function(x_12) {
v = x_12;
(function () { return x_12 + v; });
(function () { return x_12 + v; });
};
var v;
for (var x_12 in []) {
_loop_12(x_12);
}
use(v);
}
function foo1_c(x) {
var _loop_13 = function(x_13) {
v = x_13;
(function () { return x_13 + v; });
(function () { return x_13 + v; });
};
var v;
for (var x_13 = 0; x_13 < 1;) {
_loop_13(x_13);
}
use(v);
}
function foo2_c(x) {
var _loop_14 = function() {
var x_14 = 1;
v = x_14;
(function () { return x_14 + v; });
(function () { return x_14 + v; });
};
var v;
while (1 === 1) {
_loop_14();
}
use(v);
}
function foo3_c(x) {
var _loop_15 = function() {
var x_15 = 1;
(function () { return x_15 + v; });
(function () { return x_15 + v; });
};
var v;
do {
_loop_15();
} while (1 === 1);
use(v);
}
function foo4_c(x) {
var _loop_16 = function(y) {
v = y;
var x_16 = 1;
(function () { return x_16 + v; });
(function () { return x_16 + v; });
};
var v;
for (var y = 0; y < 1;) {
_loop_16(y);
}
use(v);
}
function foo5_c(x) {
var _loop_17 = function(x_17, y) {
v = x_17;
(function () { return x_17 + y + v; });
(function () { return x_17 + y + v; });
};
var v;
for (var x_17 = 0, y = 1; x_17 < 1;) {
_loop_17(x_17, y);
}
use(v);
}
function foo6_c(x) {
var _loop_18 = function() {
var x_18 = 1, y = 1;
v = x_18;
(function () { return x_18 + y + v; });
(function () { return x_18 + y + v; });
};
var v;
while (1 === 1) {
_loop_18();
}
use(v);
}
function foo7_c(x) {
var _loop_19 = function() {
var x_19 = 1, y = 1;
v = x_19;
(function () { return x_19 + y + v; });
(function () { return x_19 + y + v; });
};
var v;
do {
_loop_19();
} while (1 === 1);
use(v);
}
function foo8_c(x) {
var _loop_20 = function(y) {
var x_20 = 1;
v = x_20;
(function () { return x_20 + y + v; });
(function () { return x_20 + y + v; });
};
var v;
for (var y = 0; y < 1;) {
_loop_20(y);
}
use(v);
}

View File

@@ -0,0 +1,565 @@
=== tests/cases/compiler/capturedLetConstInLoop3.ts ===
///=========let
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop3.ts, 1, 21))
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop3.ts, 1, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 2, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 3, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 4, 11))
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop3.ts, 10, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 12, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 13, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 14, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop3.ts, 20, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 22, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 23, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 24, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop3.ts, 30, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 32, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 34, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 35, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop3.ts, 41, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 43, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 45, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 46, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop3.ts, 52, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 54, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 55, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 57, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 57, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 57, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 56, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop3.ts, 63, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 65, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 66, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 66, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 66, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 66, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 67, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop3.ts, 73, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 76, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 78, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 78, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 78, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 78, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 79, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop3.ts, 85, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 87, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 89, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 89, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 89, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 89, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 90, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop3.ts, 96, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 99, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 100, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 102, 11))
}
//===const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop3.ts, 108, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 110, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 111, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 112, 11))
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop3.ts, 118, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 120, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 121, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 122, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop3.ts, 128, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 130, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 131, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 132, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop3.ts, 138, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 140, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 142, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 143, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop3.ts, 149, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 151, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 153, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 153, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 153, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 154, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop3.ts, 160, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 162, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 163, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 163, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 163, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 165, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 165, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 165, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 164, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop3.ts, 171, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 173, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 174, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 174, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 174, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 174, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 175, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop3.ts, 181, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 184, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 186, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 186, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 186, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 186, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 187, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop3.ts, 193, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 195, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 197, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 197, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 197, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 197, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 198, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop3.ts, 204, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 207, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3.ts, 209, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3.ts, 208, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3.ts, 210, 11))
}

View File

@@ -0,0 +1,794 @@
=== tests/cases/compiler/capturedLetConstInLoop3.ts ===
///=========let
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//===const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
const x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}

View File

@@ -0,0 +1,394 @@
//// [capturedLetConstInLoop3_ES6.ts]
///=========let
declare function use(a: any);
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//===const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo0_1_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
const x = 1;
(function() { return x + v });
(() => x + v);
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
}
use(v);
}
//// [capturedLetConstInLoop3_ES6.js]
function foo0(x) {
for (let x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo0_1(x) {
for (let x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function () { return x + v; });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo7(x) {
do {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
//===const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo0_1_c(x) {
for (const x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function () { return x + v; });
(() => x + v);
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
const x = 1;
(function () { return x + v; });
(() => x + v);
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
}
use(v);
}

View File

@@ -0,0 +1,566 @@
=== tests/cases/compiler/capturedLetConstInLoop3_ES6.ts ===
///=========let
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop3_ES6.ts, 2, 21))
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop3_ES6.ts, 2, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 3, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 5, 11))
}
function foo0_1(x) {
>foo0_1 : Symbol(foo0_1, Decl(capturedLetConstInLoop3_ES6.ts, 11, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 13, 16))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 14, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 15, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop3_ES6.ts, 21, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 23, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 24, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 25, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop3_ES6.ts, 31, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 33, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 35, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 36, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop3_ES6.ts, 42, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 44, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 46, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 46, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 46, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 47, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop3_ES6.ts, 53, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 55, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 56, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 58, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 57, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop3_ES6.ts, 64, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 66, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 67, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 67, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 67, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 67, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 68, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop3_ES6.ts, 74, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 77, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 79, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 79, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 79, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 79, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 80, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop3_ES6.ts, 86, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 88, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 90, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 90, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 90, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 90, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 91, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop3_ES6.ts, 97, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 100, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 102, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 101, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 103, 11))
}
//===const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop3_ES6.ts, 109, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 111, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 112, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 113, 11))
}
function foo0_1_c(x) {
>foo0_1_c : Symbol(foo0_1_c, Decl(capturedLetConstInLoop3_ES6.ts, 119, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 121, 18))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 122, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 123, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop3_ES6.ts, 129, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 131, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 132, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 133, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop3_ES6.ts, 139, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 141, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 143, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 144, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop3_ES6.ts, 150, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 152, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 154, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 154, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 154, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 155, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop3_ES6.ts, 161, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 163, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 164, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 164, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 164, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 166, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 166, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 166, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 165, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop3_ES6.ts, 172, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 174, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 175, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 175, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 175, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 175, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 176, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop3_ES6.ts, 182, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 185, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 187, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 187, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 187, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 187, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 188, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop3_ES6.ts, 194, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 196, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 198, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 198, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 198, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 198, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 199, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop3_ES6.ts, 205, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 208, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop3_ES6.ts, 210, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop3_ES6.ts, 209, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop3_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop3_ES6.ts, 211, 11))
}

View File

@@ -0,0 +1,795 @@
=== tests/cases/compiler/capturedLetConstInLoop3_ES6.ts ===
///=========let
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1(x) {
>foo0_1 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//===const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo0_1_c(x) {
>foo0_1_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
const x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}

View File

@@ -0,0 +1,338 @@
//// [capturedLetConstInLoop4.ts]
//======let
export function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
for (let x of []) {
var v0 = x;
(function() { return x + v0});
(() => x);
}
for (let x in []) {
var v00 = x;
(function() { return x + v00});
(() => x);
}
for (let x = 0; x < 1; ++x) {
var v1 = x;
(function() { return x + v1});
(() => x);
}
while (1 === 1) {
let x;
var v2 = x;
(function() { return x + v2});
(() => x);
}
do {
let x;
var v3 = x;
(function() { return x + v3});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v4 = x;
(function() { return x + v4});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
var v5 = x;
(function() { return x + y + v5});
(() => x + y);
}
while (1 === 1) {
let x, y;
var v6 = x;
(function() { return x + y + v6});
(() => x + y);
}
do {
let x, y;
var v7 = x;
(function() { return x + y + v7});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v8 = x;
(function() { return x + y + v8});
(() => x + y);
}
//======const
export function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
for (const x of []) {
var v0_c = x;
(function() { return x + v0_c});
(() => x);
}
for (const x in []) {
var v00_c = x;
(function() { return x + v00});
(() => x);
}
for (const x = 0; x < 1;) {
var v1_c = x;
(function() { return x + v1_c});
(() => x);
}
while (1 === 1) {
const x =1;
var v2_c = x;
(function() { return x + v2_c});
(() => x);
}
do {
const x = 1;
var v3_c = x;
(function() { return x + v3_c});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v4_c = x;
(function() { return x + v4_c});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
var v5_c = x;
(function() { return x + y + v5_c});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
var v6_c = x;
(function() { return x + y + v6_c});
(() => x + y);
}
do {
const x = 1, y = 1;
var v7_c = x;
(function() { return x + y + v7_c});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v8_c = x;
(function() { return x + y + v8_c});
(() => x + y);
}
//// [capturedLetConstInLoop4.js]
System.register([], function(exports_1) {
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
//======let
function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
exports_1("exportedFoo", exportedFoo);
//======const
function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
exports_1("exportedFoo2", exportedFoo2);
return {
setters:[],
execute: function() {
var _loop_1 = function(x) {
v0 = x;
(function () { return x + v0; });
(function () { return x; });
};
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
_loop_1(x);
}
var _loop_2 = function(x) {
v00 = x;
(function () { return x + v00; });
(function () { return x; });
};
for (var x in []) {
_loop_2(x);
}
var _loop_3 = function(x) {
v1 = x;
(function () { return x + v1; });
(function () { return x; });
};
for (var x = 0; x < 1; ++x) {
_loop_3(x);
}
var _loop_4 = function() {
var x = void 0;
v2 = x;
(function () { return x + v2; });
(function () { return x; });
};
while (1 === 1) {
_loop_4();
}
var _loop_5 = function() {
var x = void 0;
v3 = x;
(function () { return x + v3; });
(function () { return x; });
};
do {
_loop_5();
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
v4 = x;
(function () { return x + v4; });
(function () { return x; });
};
for (var y = 0; y < 1; ++y) {
_loop_6(y);
}
var _loop_7 = function(x, y) {
v5 = x;
(function () { return x + y + v5; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1; ++x) {
_loop_7(x, y);
}
var _loop_8 = function() {
var x = void 0, y = void 0;
v6 = x;
(function () { return x + y + v6; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_8();
}
var _loop_9 = function() {
var x = void 0, y = void 0;
v7 = x;
(function () { return x + y + v7; });
(function () { return x + y; });
};
do {
_loop_9();
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
v8 = x;
(function () { return x + y + v8; });
(function () { return x + y; });
};
for (var y = 0; y < 1; ++y) {
_loop_10(y);
}
var _loop_11 = function(x) {
v0_c = x;
(function () { return x + v0_c; });
(function () { return x; });
};
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
_loop_11(x);
}
var _loop_12 = function(x) {
v00_c = x;
(function () { return x + v00; });
(function () { return x; });
};
for (var x in []) {
_loop_12(x);
}
var _loop_13 = function(x) {
v1_c = x;
(function () { return x + v1_c; });
(function () { return x; });
};
for (var x = 0; x < 1;) {
_loop_13(x);
}
var _loop_14 = function() {
var x = 1;
v2_c = x;
(function () { return x + v2_c; });
(function () { return x; });
};
while (1 === 1) {
_loop_14();
}
var _loop_15 = function() {
var x = 1;
v3_c = x;
(function () { return x + v3_c; });
(function () { return x; });
};
do {
_loop_15();
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
v4_c = x;
(function () { return x + v4_c; });
(function () { return x; });
};
for (var y = 0; y < 1;) {
_loop_16(y);
}
var _loop_17 = function(x, y) {
v5_c = x;
(function () { return x + y + v5_c; });
(function () { return x + y; });
};
for (var x = 0, y = 1; x < 1;) {
_loop_17(x, y);
}
var _loop_18 = function() {
var x = 1, y = 1;
v6_c = x;
(function () { return x + y + v6_c; });
(function () { return x + y; });
};
while (1 === 1) {
_loop_18();
}
var _loop_19 = function() {
var x = 1, y = 1;
v7_c = x;
(function () { return x + y + v7_c; });
(function () { return x + y; });
};
do {
_loop_19();
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
v8_c = x;
(function () { return x + y + v8_c; });
(function () { return x + y; });
};
for (var y = 0; y < 1;) {
_loop_20(y);
}
}
}
});

View File

@@ -0,0 +1,394 @@
=== tests/cases/compiler/capturedLetConstInLoop4.ts ===
//======let
export function exportedFoo() {
>exportedFoo : Symbol(exportedFoo, Decl(capturedLetConstInLoop4.ts, 0, 0))
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4.ts, 7, 7))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4.ts, 19, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4.ts, 26, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4.ts, 33, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4.ts, 40, 7))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4.ts, 46, 7))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4.ts, 53, 7))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4.ts, 60, 7))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4.ts, 67, 7))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
var v0 = x;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4.ts, 7, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
(function() { return x + v0});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4.ts, 7, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 6, 8))
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
var v00 = x;
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 12, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
var v1 = x;
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4.ts, 19, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
(function() { return x + v1});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4.ts, 19, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 18, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
var v2 = x;
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4.ts, 26, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
(function() { return x + v2});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4.ts, 26, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 25, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
var v3 = x;
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4.ts, 33, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
(function() { return x + v3});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4.ts, 33, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 32, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 38, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
var v4 = x;
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4.ts, 40, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
(function() { return x + v4});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4.ts, 40, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 39, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 45, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
var v5 = x;
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4.ts, 46, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
(function() { return x + y + v5});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 45, 15))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4.ts, 46, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 45, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 52, 10))
var v6 = x;
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4.ts, 53, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
(function() { return x + y + v6});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 52, 10))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4.ts, 53, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 52, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 59, 10))
var v7 = x;
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4.ts, 60, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
(function() { return x + y + v7});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 59, 10))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4.ts, 60, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 59, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
var v8 = x;
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4.ts, 67, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
(function() { return x + y + v8});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4.ts, 67, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 65, 8))
}
//======const
export function exportedFoo2() {
>exportedFoo2 : Symbol(exportedFoo2, Decl(capturedLetConstInLoop4.ts, 70, 1))
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4.ts, 78, 7))
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4.ts, 84, 7))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4.ts, 90, 7))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4.ts, 97, 7))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4.ts, 104, 7))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4.ts, 111, 7))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4.ts, 117, 7))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4.ts, 124, 7))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4.ts, 131, 7))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4.ts, 138, 7))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
var v0_c = x;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4.ts, 78, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
(function() { return x + v0_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4.ts, 78, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 77, 10))
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
var v00_c = x;
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4.ts, 84, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 83, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
var v1_c = x;
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4.ts, 90, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
(function() { return x + v1_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4.ts, 90, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 89, 10))
}
while (1 === 1) {
const x =1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
var v2_c = x;
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4.ts, 97, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
(function() { return x + v2_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4.ts, 97, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 96, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
var v3_c = x;
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4.ts, 104, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
(function() { return x + v3_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4.ts, 104, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 103, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 109, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 109, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
var v4_c = x;
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4.ts, 111, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
(function() { return x + v4_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4.ts, 111, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 110, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 116, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
var v5_c = x;
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4.ts, 117, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
(function() { return x + y + v5_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 116, 17))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4.ts, 117, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 116, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 123, 16))
var v6_c = x;
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4.ts, 124, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
(function() { return x + y + v6_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 123, 16))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4.ts, 124, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 123, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 130, 16))
var v7_c = x;
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4.ts, 131, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
(function() { return x + y + v7_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 130, 16))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4.ts, 131, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 130, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
var v8_c = x;
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4.ts, 138, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
(function() { return x + y + v8_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4.ts, 138, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4.ts, 136, 10))
}

View File

@@ -0,0 +1,600 @@
=== tests/cases/compiler/capturedLetConstInLoop4.ts ===
//======let
export function exportedFoo() {
>exportedFoo : () => any
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 : any
>v0 + v00 + v1 + v2 + v3 + v4 : any
>v0 + v00 + v1 + v2 + v3 : any
>v0 + v00 + v1 + v2 : any
>v0 + v00 + v1 : any
>v0 + v00 : any
>v0 : any
>v00 : any
>v1 : number
>v2 : any
>v3 : any
>v4 : number
>v5 : number
>v6 : any
>v7 : any
>v8 : number
}
for (let x of []) {
>x : any
>[] : undefined[]
var v0 = x;
>v0 : any
>x : any
(function() { return x + v0});
>(function() { return x + v0}) : () => any
>function() { return x + v0} : () => any
>x + v0 : any
>x : any
>v0 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x in []) {
>x : any
>[] : undefined[]
var v00 = x;
>v00 : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v1 = x;
>v1 : number
>x : number
(function() { return x + v1});
>(function() { return x + v1}) : () => number
>function() { return x + v1} : () => number
>x + v1 : number
>x : number
>v1 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
var v2 = x;
>v2 : any
>x : any
(function() { return x + v2});
>(function() { return x + v2}) : () => any
>function() { return x + v2} : () => any
>x + v2 : any
>x : any
>v2 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
var v3 = x;
>v3 : any
>x : any
(function() { return x + v3});
>(function() { return x + v3}) : () => any
>function() { return x + v3} : () => any
>x + v3 : any
>x : any
>v3 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v4 = x;
>v4 : number
>x : number
(function() { return x + v4});
>(function() { return x + v4}) : () => number
>function() { return x + v4} : () => number
>x + v4 : number
>x : number
>v4 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v5 = x;
>v5 : number
>x : number
(function() { return x + y + v5});
>(function() { return x + y + v5}) : () => number
>function() { return x + y + v5} : () => number
>x + y + v5 : number
>x + y : number
>x : number
>y : number
>v5 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v6 = x;
>v6 : any
>x : any
(function() { return x + y + v6});
>(function() { return x + y + v6}) : () => any
>function() { return x + y + v6} : () => any
>x + y + v6 : any
>x + y : any
>x : any
>y : any
>v6 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
var v7 = x;
>v7 : any
>x : any
(function() { return x + y + v7});
>(function() { return x + y + v7}) : () => any
>function() { return x + y + v7} : () => any
>x + y + v7 : any
>x + y : any
>x : any
>y : any
>v7 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v8 = x;
>v8 : number
>x : number
(function() { return x + y + v8});
>(function() { return x + y + v8}) : () => number
>function() { return x + y + v8} : () => number
>x + y + v8 : number
>x + y : number
>x : number
>y : number
>v8 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//======const
export function exportedFoo2() {
>exportedFoo2 : () => any
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c : any
>v0_c + v00_c + v1_c + v2_c : any
>v0_c + v00_c + v1_c : any
>v0_c + v00_c : any
>v0_c : any
>v00_c : any
>v1_c : number
>v2_c : number
>v3_c : number
>v4_c : number
>v5_c : number
>v6_c : number
>v7_c : number
>v8_c : number
}
for (const x of []) {
>x : any
>[] : undefined[]
var v0_c = x;
>v0_c : any
>x : any
(function() { return x + v0_c});
>(function() { return x + v0_c}) : () => any
>function() { return x + v0_c} : () => any
>x + v0_c : any
>x : any
>v0_c : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x in []) {
>x : any
>[] : undefined[]
var v00_c = x;
>v00_c : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v1_c = x;
>v1_c : number
>x : number
(function() { return x + v1_c});
>(function() { return x + v1_c}) : () => number
>function() { return x + v1_c} : () => number
>x + v1_c : number
>x : number
>v1_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x =1;
>x : number
>1 : number
var v2_c = x;
>v2_c : number
>x : number
(function() { return x + v2_c});
>(function() { return x + v2_c}) : () => number
>function() { return x + v2_c} : () => number
>x + v2_c : number
>x : number
>v2_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
var v3_c = x;
>v3_c : number
>x : number
(function() { return x + v3_c});
>(function() { return x + v3_c}) : () => number
>function() { return x + v3_c} : () => number
>x + v3_c : number
>x : number
>v3_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v4_c = x;
>v4_c : number
>x : number
(function() { return x + v4_c});
>(function() { return x + v4_c}) : () => number
>function() { return x + v4_c} : () => number
>x + v4_c : number
>x : number
>v4_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v5_c = x;
>v5_c : number
>x : number
(function() { return x + y + v5_c});
>(function() { return x + y + v5_c}) : () => number
>function() { return x + y + v5_c} : () => number
>x + y + v5_c : number
>x + y : number
>x : number
>y : number
>v5_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v6_c = x;
>v6_c : number
>x : number
(function() { return x + y + v6_c});
>(function() { return x + y + v6_c}) : () => number
>function() { return x + y + v6_c} : () => number
>x + y + v6_c : number
>x + y : number
>x : number
>y : number
>v6_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v7_c = x;
>v7_c : number
>x : number
(function() { return x + y + v7_c});
>(function() { return x + y + v7_c}) : () => number
>function() { return x + y + v7_c} : () => number
>x + y + v7_c : number
>x + y : number
>x : number
>y : number
>v7_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v8_c = x;
>v8_c : number
>x : number
(function() { return x + y + v8_c});
>(function() { return x + y + v8_c}) : () => number
>function() { return x + y + v8_c} : () => number
>x + y + v8_c : number
>x + y : number
>x : number
>y : number
>v8_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}

View File

@@ -0,0 +1,266 @@
//// [capturedLetConstInLoop4_ES6.ts]
//======let
export function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
for (let x of []) {
var v0 = x;
(function() { return x + v0});
(() => x);
}
for (let x in []) {
var v00 = x;
(function() { return x + v00});
(() => x);
}
for (let x = 0; x < 1; ++x) {
var v1 = x;
(function() { return x + v1});
(() => x);
}
while (1 === 1) {
let x;
var v2 = x;
(function() { return x + v2});
(() => x);
}
do {
let x;
var v3 = x;
(function() { return x + v3});
(() => x);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v4 = x;
(function() { return x + v4});
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
var v5 = x;
(function() { return x + y + v5});
(() => x + y);
}
while (1 === 1) {
let x, y;
var v6 = x;
(function() { return x + y + v6});
(() => x + y);
}
do {
let x, y;
var v7 = x;
(function() { return x + y + v7});
(() => x + y);
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
var v8 = x;
(function() { return x + y + v8});
(() => x + y);
}
//======const
export function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
for (const x of []) {
var v0_c = x;
(function() { return x + v0_c});
(() => x);
}
for (const x in []) {
var v00_c = x;
(function() { return x + v00});
(() => x);
}
for (const x = 0; x < 1;) {
var v1_c = x;
(function() { return x + v1_c});
(() => x);
}
while (1 === 1) {
const x =1;
var v2_c = x;
(function() { return x + v2_c});
(() => x);
}
do {
const x = 1;
var v3_c = x;
(function() { return x + v3_c});
(() => x);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v4_c = x;
(function() { return x + v4_c});
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
var v5_c = x;
(function() { return x + y + v5_c});
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
var v6_c = x;
(function() { return x + y + v6_c});
(() => x + y);
}
do {
const x = 1, y = 1;
var v7_c = x;
(function() { return x + y + v7_c});
(() => x + y);
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
var v8_c = x;
(function() { return x + y + v8_c});
(() => x + y);
}
//// [capturedLetConstInLoop4_ES6.js]
//======let
export function exportedFoo() {
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
}
for (let x of []) {
var v0 = x;
(function () { return x + v0; });
(() => x);
}
for (let x in []) {
var v00 = x;
(function () { return x + v00; });
(() => x);
}
for (let x = 0; x < 1; ++x) {
var v1 = x;
(function () { return x + v1; });
(() => x);
}
while (1 === 1) {
let x;
var v2 = x;
(function () { return x + v2; });
(() => x);
}
do {
let x;
var v3 = x;
(function () { return x + v3; });
(() => x);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
var v4 = x;
(function () { return x + v4; });
(() => x);
}
for (let x = 0, y = 1; x < 1; ++x) {
var v5 = x;
(function () { return x + y + v5; });
(() => x + y);
}
while (1 === 1) {
let x, y;
var v6 = x;
(function () { return x + y + v6; });
(() => x + y);
}
do {
let x, y;
var v7 = x;
(function () { return x + y + v7; });
(() => x + y);
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
var v8 = x;
(function () { return x + y + v8; });
(() => x + y);
}
//======const
export function exportedFoo2() {
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
}
for (const x of []) {
var v0_c = x;
(function () { return x + v0_c; });
(() => x);
}
for (const x in []) {
var v00_c = x;
(function () { return x + v00; });
(() => x);
}
for (const x = 0; x < 1;) {
var v1_c = x;
(function () { return x + v1_c; });
(() => x);
}
while (1 === 1) {
const x = 1;
var v2_c = x;
(function () { return x + v2_c; });
(() => x);
}
do {
const x = 1;
var v3_c = x;
(function () { return x + v3_c; });
(() => x);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
var v4_c = x;
(function () { return x + v4_c; });
(() => x);
}
for (const x = 0, y = 1; x < 1;) {
var v5_c = x;
(function () { return x + y + v5_c; });
(() => x + y);
}
while (1 === 1) {
const x = 1, y = 1;
var v6_c = x;
(function () { return x + y + v6_c; });
(() => x + y);
}
do {
const x = 1, y = 1;
var v7_c = x;
(function () { return x + y + v7_c; });
(() => x + y);
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
var v8_c = x;
(function () { return x + y + v8_c; });
(() => x + y);
}

View File

@@ -0,0 +1,394 @@
=== tests/cases/compiler/capturedLetConstInLoop4_ES6.ts ===
//======let
export function exportedFoo() {
>exportedFoo : Symbol(exportedFoo, Decl(capturedLetConstInLoop4_ES6.ts, 0, 0))
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4_ES6.ts, 7, 7))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4_ES6.ts, 19, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4_ES6.ts, 26, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4_ES6.ts, 33, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4_ES6.ts, 40, 7))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4_ES6.ts, 46, 7))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4_ES6.ts, 53, 7))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4_ES6.ts, 60, 7))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4_ES6.ts, 67, 7))
}
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
var v0 = x;
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4_ES6.ts, 7, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
(function() { return x + v0});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
>v0 : Symbol(v0, Decl(capturedLetConstInLoop4_ES6.ts, 7, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 6, 8))
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
var v00 = x;
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 12, 8))
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
var v1 = x;
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4_ES6.ts, 19, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
(function() { return x + v1});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
>v1 : Symbol(v1, Decl(capturedLetConstInLoop4_ES6.ts, 19, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 18, 8))
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
var v2 = x;
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4_ES6.ts, 26, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
(function() { return x + v2});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
>v2 : Symbol(v2, Decl(capturedLetConstInLoop4_ES6.ts, 26, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 25, 7))
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
var v3 = x;
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4_ES6.ts, 33, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
(function() { return x + v3});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
>v3 : Symbol(v3, Decl(capturedLetConstInLoop4_ES6.ts, 33, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 32, 7))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 38, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 38, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
var v4 = x;
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4_ES6.ts, 40, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
(function() { return x + v4});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
>v4 : Symbol(v4, Decl(capturedLetConstInLoop4_ES6.ts, 40, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 39, 7))
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 45, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
var v5 = x;
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4_ES6.ts, 46, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
(function() { return x + y + v5});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 45, 15))
>v5 : Symbol(v5, Decl(capturedLetConstInLoop4_ES6.ts, 46, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 45, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 45, 15))
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 52, 10))
var v6 = x;
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4_ES6.ts, 53, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
(function() { return x + y + v6});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 52, 10))
>v6 : Symbol(v6, Decl(capturedLetConstInLoop4_ES6.ts, 53, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 52, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 52, 10))
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 59, 10))
var v7 = x;
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4_ES6.ts, 60, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
(function() { return x + y + v7});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 59, 10))
>v7 : Symbol(v7, Decl(capturedLetConstInLoop4_ES6.ts, 60, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 59, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 59, 10))
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
var v8 = x;
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4_ES6.ts, 67, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
(function() { return x + y + v8});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
>v8 : Symbol(v8, Decl(capturedLetConstInLoop4_ES6.ts, 67, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 66, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 65, 8))
}
//======const
export function exportedFoo2() {
>exportedFoo2 : Symbol(exportedFoo2, Decl(capturedLetConstInLoop4_ES6.ts, 70, 1))
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4_ES6.ts, 78, 7))
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4_ES6.ts, 84, 7))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4_ES6.ts, 90, 7))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4_ES6.ts, 97, 7))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4_ES6.ts, 104, 7))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4_ES6.ts, 111, 7))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4_ES6.ts, 117, 7))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4_ES6.ts, 124, 7))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4_ES6.ts, 131, 7))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4_ES6.ts, 138, 7))
}
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
var v0_c = x;
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4_ES6.ts, 78, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
(function() { return x + v0_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
>v0_c : Symbol(v0_c, Decl(capturedLetConstInLoop4_ES6.ts, 78, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 77, 10))
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
var v00_c = x;
>v00_c : Symbol(v00_c, Decl(capturedLetConstInLoop4_ES6.ts, 84, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
(function() { return x + v00});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
>v00 : Symbol(v00, Decl(capturedLetConstInLoop4_ES6.ts, 13, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 83, 10))
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
var v1_c = x;
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4_ES6.ts, 90, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
(function() { return x + v1_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
>v1_c : Symbol(v1_c, Decl(capturedLetConstInLoop4_ES6.ts, 90, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 89, 10))
}
while (1 === 1) {
const x =1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
var v2_c = x;
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4_ES6.ts, 97, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
(function() { return x + v2_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
>v2_c : Symbol(v2_c, Decl(capturedLetConstInLoop4_ES6.ts, 97, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 96, 9))
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
var v3_c = x;
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4_ES6.ts, 104, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
(function() { return x + v3_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
>v3_c : Symbol(v3_c, Decl(capturedLetConstInLoop4_ES6.ts, 104, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 103, 9))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 109, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 109, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
var v4_c = x;
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4_ES6.ts, 111, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
(function() { return x + v4_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
>v4_c : Symbol(v4_c, Decl(capturedLetConstInLoop4_ES6.ts, 111, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 110, 9))
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 116, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
var v5_c = x;
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4_ES6.ts, 117, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
(function() { return x + y + v5_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 116, 17))
>v5_c : Symbol(v5_c, Decl(capturedLetConstInLoop4_ES6.ts, 117, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 116, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 116, 17))
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 123, 16))
var v6_c = x;
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4_ES6.ts, 124, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
(function() { return x + y + v6_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 123, 16))
>v6_c : Symbol(v6_c, Decl(capturedLetConstInLoop4_ES6.ts, 124, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 123, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 123, 16))
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 130, 16))
var v7_c = x;
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4_ES6.ts, 131, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
(function() { return x + y + v7_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 130, 16))
>v7_c : Symbol(v7_c, Decl(capturedLetConstInLoop4_ES6.ts, 131, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 130, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 130, 16))
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
var v8_c = x;
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4_ES6.ts, 138, 7))
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
(function() { return x + y + v8_c});
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
>v8_c : Symbol(v8_c, Decl(capturedLetConstInLoop4_ES6.ts, 138, 7))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop4_ES6.ts, 137, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop4_ES6.ts, 136, 10))
}

View File

@@ -0,0 +1,600 @@
=== tests/cases/compiler/capturedLetConstInLoop4_ES6.ts ===
//======let
export function exportedFoo() {
>exportedFoo : () => any
return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8;
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 : any
>v0 + v00 + v1 + v2 + v3 + v4 + v5 : any
>v0 + v00 + v1 + v2 + v3 + v4 : any
>v0 + v00 + v1 + v2 + v3 : any
>v0 + v00 + v1 + v2 : any
>v0 + v00 + v1 : any
>v0 + v00 : any
>v0 : any
>v00 : any
>v1 : number
>v2 : any
>v3 : any
>v4 : number
>v5 : number
>v6 : any
>v7 : any
>v8 : number
}
for (let x of []) {
>x : any
>[] : undefined[]
var v0 = x;
>v0 : any
>x : any
(function() { return x + v0});
>(function() { return x + v0}) : () => any
>function() { return x + v0} : () => any
>x + v0 : any
>x : any
>v0 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x in []) {
>x : any
>[] : undefined[]
var v00 = x;
>v00 : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v1 = x;
>v1 : number
>x : number
(function() { return x + v1});
>(function() { return x + v1}) : () => number
>function() { return x + v1} : () => number
>x + v1 : number
>x : number
>v1 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
var v2 = x;
>v2 : any
>x : any
(function() { return x + v2});
>(function() { return x + v2}) : () => any
>function() { return x + v2} : () => any
>x + v2 : any
>x : any
>v2 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
do {
let x;
>x : any
var v3 = x;
>v3 : any
>x : any
(function() { return x + v3});
>(function() { return x + v3}) : () => any
>function() { return x + v3} : () => any
>x + v3 : any
>x : any
>v3 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v4 = x;
>v4 : number
>x : number
(function() { return x + v4});
>(function() { return x + v4}) : () => number
>function() { return x + v4} : () => number
>x + v4 : number
>x : number
>v4 : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v5 = x;
>v5 : number
>x : number
(function() { return x + y + v5});
>(function() { return x + y + v5}) : () => number
>function() { return x + y + v5} : () => number
>x + y + v5 : number
>x + y : number
>x : number
>y : number
>v5 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v6 = x;
>v6 : any
>x : any
(function() { return x + y + v6});
>(function() { return x + y + v6}) : () => any
>function() { return x + y + v6} : () => any
>x + y + v6 : any
>x + y : any
>x : any
>y : any
>v6 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
}
do {
let x, y;
>x : any
>y : any
var v7 = x;
>v7 : any
>x : any
(function() { return x + y + v7});
>(function() { return x + y + v7}) : () => any
>function() { return x + y + v7} : () => any
>x + y + v7 : any
>x + y : any
>x : any
>y : any
>v7 : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v8 = x;
>v8 : number
>x : number
(function() { return x + y + v8});
>(function() { return x + y + v8}) : () => number
>function() { return x + y + v8} : () => number
>x + y + v8 : number
>x + y : number
>x : number
>y : number
>v8 : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
//======const
export function exportedFoo2() {
>exportedFoo2 : () => any
return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c;
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c + v4_c : any
>v0_c + v00_c + v1_c + v2_c + v3_c : any
>v0_c + v00_c + v1_c + v2_c : any
>v0_c + v00_c + v1_c : any
>v0_c + v00_c : any
>v0_c : any
>v00_c : any
>v1_c : number
>v2_c : number
>v3_c : number
>v4_c : number
>v5_c : number
>v6_c : number
>v7_c : number
>v8_c : number
}
for (const x of []) {
>x : any
>[] : undefined[]
var v0_c = x;
>v0_c : any
>x : any
(function() { return x + v0_c});
>(function() { return x + v0_c}) : () => any
>function() { return x + v0_c} : () => any
>x + v0_c : any
>x : any
>v0_c : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x in []) {
>x : any
>[] : undefined[]
var v00_c = x;
>v00_c : any
>x : any
(function() { return x + v00});
>(function() { return x + v00}) : () => any
>function() { return x + v00} : () => any
>x + v00 : any
>x : any
>v00 : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v1_c = x;
>v1_c : number
>x : number
(function() { return x + v1_c});
>(function() { return x + v1_c}) : () => number
>function() { return x + v1_c} : () => number
>x + v1_c : number
>x : number
>v1_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x =1;
>x : number
>1 : number
var v2_c = x;
>v2_c : number
>x : number
(function() { return x + v2_c});
>(function() { return x + v2_c}) : () => number
>function() { return x + v2_c} : () => number
>x + v2_c : number
>x : number
>v2_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
do {
const x = 1;
>x : number
>1 : number
var v3_c = x;
>v3_c : number
>x : number
(function() { return x + v3_c});
>(function() { return x + v3_c}) : () => number
>function() { return x + v3_c} : () => number
>x + v3_c : number
>x : number
>v3_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v4_c = x;
>v4_c : number
>x : number
(function() { return x + v4_c});
>(function() { return x + v4_c}) : () => number
>function() { return x + v4_c} : () => number
>x + v4_c : number
>x : number
>v4_c : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v5_c = x;
>v5_c : number
>x : number
(function() { return x + y + v5_c});
>(function() { return x + y + v5_c}) : () => number
>function() { return x + y + v5_c} : () => number
>x + y + v5_c : number
>x + y : number
>x : number
>y : number
>v5_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v6_c = x;
>v6_c : number
>x : number
(function() { return x + y + v6_c});
>(function() { return x + y + v6_c}) : () => number
>function() { return x + y + v6_c} : () => number
>x + y + v6_c : number
>x + y : number
>x : number
>y : number
>v6_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v7_c = x;
>v7_c : number
>x : number
(function() { return x + y + v7_c});
>(function() { return x + y + v7_c}) : () => number
>function() { return x + y + v7_c} : () => number
>x + y + v7_c : number
>x + y : number
>x : number
>y : number
>v7_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v8_c = x;
>v8_c : number
>x : number
(function() { return x + y + v8_c});
>(function() { return x + y + v8_c}) : () => number
>function() { return x + y + v8_c} : () => number
>x + y + v8_c : number
>x + y : number
>x : number
>y : number
>v8_c : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
}

View File

@@ -0,0 +1,617 @@
//// [capturedLetConstInLoop5.ts]
declare function use(a: any);
//====let
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
};
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//====const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//// [capturedLetConstInLoop5.js]
//====let
function foo0(x) {
var _loop_1 = function(x_1) {
v = x_1;
(function () { return x_1 + v; });
(function () { return x_1 + v; });
if (x_1 == 1) {
return { value: void 0 };
}
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_1 = _a[_i];
var state_1 = _loop_1(x_1);
if (typeof state_1 === "object") return state_1.value
}
use(v);
}
function foo00(x) {
var _loop_2 = function(x_2) {
v = x_2;
(function () { return x_2 + v; });
(function () { return x_2 + v; });
if (x_2 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_2 in []) {
var state_2 = _loop_2(x_2);
if (typeof state_2 === "object") return state_2.value
}
use(v);
}
function foo1(x) {
var _loop_3 = function(x_3) {
v = x_3;
(function () { return x_3 + v; });
(function () { return x_3 + v; });
if (x_3 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_3 = 0; x_3 < 1; ++x_3) {
var state_3 = _loop_3(x_3);
if (typeof state_3 === "object") return state_3.value
}
use(v);
}
function foo2(x) {
var _loop_4 = function() {
var x_4 = 1;
v = x_4;
(function () { return x_4 + v; });
(function () { return x_4 + v; });
if (x_4 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_4 = _loop_4();
if (typeof state_4 === "object") return state_4.value
}
use(v);
}
function foo3(x) {
var _loop_5 = function() {
var x_5 = void 0;
(function () { return x_5 + v; });
(function () { return x_5 + v; });
if (x_5 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_5 = _loop_5();
if (typeof state_5 === "object") return state_5.value
} while (1 === 1);
use(v);
}
function foo4(x) {
var _loop_6 = function(y) {
v = y;
var x_6 = 1;
(function () { return x_6 + v; });
(function () { return x_6 + v; });
if (x_6 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1; ++y) {
var state_6 = _loop_6(y);
if (typeof state_6 === "object") return state_6.value
}
use(v);
}
function foo5(x) {
var _loop_7 = function(x_7, y) {
v = x_7;
(function () { return x_7 + y + v; });
(function () { return x_7 + y + v; });
if (x_7 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_7 = 0, y = 1; x_7 < 1; ++x_7) {
var state_7 = _loop_7(x_7, y);
if (typeof state_7 === "object") return state_7.value
}
use(v);
}
function foo6(x) {
var _loop_8 = function() {
var x_8 = void 0, y = void 0;
v = x_8;
(function () { return x_8 + y + v; });
(function () { return x_8 + y + v; });
if (x_8 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_8 = _loop_8();
if (typeof state_8 === "object") return state_8.value
}
;
use(v);
}
function foo7(x) {
var _loop_9 = function() {
var x_9 = void 0, y = void 0;
v = x_9;
(function () { return x_9 + y + v; });
(function () { return x_9 + y + v; });
if (x_9 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_9 = _loop_9();
if (typeof state_9 === "object") return state_9.value
} while (1 === 1);
use(v);
}
function foo8(x) {
var _loop_10 = function(y) {
var x_10 = 1;
v = x_10;
(function () { return x_10 + y + v; });
(function () { return x_10 + y + v; });
if (x_10 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1; ++y) {
var state_10 = _loop_10(y);
if (typeof state_10 === "object") return state_10.value
}
use(v);
}
//====const
function foo0_c(x) {
var _loop_11 = function(x_11) {
v = x_11;
(function () { return x_11 + v; });
(function () { return x_11 + v; });
if (x_11 == 1) {
return { value: void 0 };
}
};
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x_11 = _a[_i];
var state_11 = _loop_11(x_11);
if (typeof state_11 === "object") return state_11.value
}
use(v);
}
function foo00_c(x) {
var _loop_12 = function(x_12) {
v = x_12;
(function () { return x_12 + v; });
(function () { return x_12 + v; });
if (x_12 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_12 in []) {
var state_12 = _loop_12(x_12);
if (typeof state_12 === "object") return state_12.value
}
use(v);
}
function foo1_c(x) {
var _loop_13 = function(x_13) {
v = x_13;
(function () { return x_13 + v; });
(function () { return x_13 + v; });
if (x_13 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_13 = 0; x_13 < 1;) {
var state_13 = _loop_13(x_13);
if (typeof state_13 === "object") return state_13.value
}
use(v);
}
function foo2_c(x) {
var _loop_14 = function() {
var x_14 = 1;
v = x_14;
(function () { return x_14 + v; });
(function () { return x_14 + v; });
if (x_14 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_14 = _loop_14();
if (typeof state_14 === "object") return state_14.value
}
use(v);
}
function foo3_c(x) {
var _loop_15 = function() {
var x_15 = 1;
(function () { return x_15 + v; });
(function () { return x_15 + v; });
if (x_15 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_15 = _loop_15();
if (typeof state_15 === "object") return state_15.value
} while (1 === 1);
use(v);
}
function foo4_c(x) {
var _loop_16 = function(y) {
v = y;
var x_16 = 1;
(function () { return x_16 + v; });
(function () { return x_16 + v; });
if (x_16 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1;) {
var state_16 = _loop_16(y);
if (typeof state_16 === "object") return state_16.value
}
use(v);
}
function foo5_c(x) {
var _loop_17 = function(x_17, y) {
v = x_17;
(function () { return x_17 + y + v; });
(function () { return x_17 + y + v; });
if (x_17 == 1) {
return { value: void 0 };
}
};
var v;
for (var x_17 = 0, y = 1; x_17 < 1;) {
var state_17 = _loop_17(x_17, y);
if (typeof state_17 === "object") return state_17.value
}
use(v);
}
function foo6_c(x) {
var _loop_18 = function() {
var x_18 = 1, y = 1;
v = x_18;
(function () { return x_18 + y + v; });
(function () { return x_18 + y + v; });
if (x_18 == 1) {
return { value: void 0 };
}
};
var v;
while (1 === 1) {
var state_18 = _loop_18();
if (typeof state_18 === "object") return state_18.value
}
use(v);
}
function foo7_c(x) {
var _loop_19 = function() {
var x_19 = 1, y = 1;
v = x_19;
(function () { return x_19 + y + v; });
(function () { return x_19 + y + v; });
if (x_19 == 1) {
return { value: void 0 };
}
};
var v;
do {
var state_19 = _loop_19();
if (typeof state_19 === "object") return state_19.value
} while (1 === 1);
use(v);
}
function foo8_c(x) {
var _loop_20 = function(y) {
var x_20 = 1;
v = x_20;
(function () { return x_20 + y + v; });
(function () { return x_20 + y + v; });
if (x_20 == 1) {
return { value: void 0 };
}
};
var v;
for (var y = 0; y < 1;) {
var state_20 = _loop_20(y);
if (typeof state_20 === "object") return state_20.value
}
use(v);
}

View File

@@ -0,0 +1,682 @@
=== tests/cases/compiler/capturedLetConstInLoop5.ts ===
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop5.ts, 0, 21))
//====let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop5.ts, 0, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 3, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 4, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 5, 11))
}
function foo00(x) {
>foo00 : Symbol(foo00, Decl(capturedLetConstInLoop5.ts, 14, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 16, 15))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 17, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 18, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop5.ts, 27, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 29, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 30, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 31, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop5.ts, 40, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 42, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 44, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 45, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop5.ts, 54, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 56, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 58, 11))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 59, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop5.ts, 68, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 70, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 71, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 73, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 72, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop5.ts, 82, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 84, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 85, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 85, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 85, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 85, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 86, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop5.ts, 95, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 98, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 100, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 100, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 100, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 100, 11))
return;
}
};
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 101, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop5.ts, 110, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 112, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 114, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 114, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 114, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 114, 11))
return;
}
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 115, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop5.ts, 124, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 127, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 128, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 129, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 130, 11))
}
//====const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop5.ts, 139, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 142, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 143, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 144, 11))
}
function foo00_c(x) {
>foo00_c : Symbol(foo00_c, Decl(capturedLetConstInLoop5.ts, 153, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 155, 17))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 156, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 157, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop5.ts, 166, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 168, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 169, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 170, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop5.ts, 179, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 181, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 183, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 184, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop5.ts, 193, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 195, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 197, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 198, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop5.ts, 207, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 209, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 210, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 210, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 210, 14))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 212, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 211, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop5.ts, 221, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 223, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 224, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 224, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 224, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 224, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 225, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop5.ts, 234, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 237, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 239, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 239, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 239, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 239, 13))
return;
}
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 240, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop5.ts, 249, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 251, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 253, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 253, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 253, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 253, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 254, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop5.ts, 263, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 266, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5.ts, 267, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5.ts, 268, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5.ts, 269, 11))
}

View File

@@ -0,0 +1,951 @@
=== tests/cases/compiler/capturedLetConstInLoop5.ts ===
declare function use(a: any);
>use : (a: any) => any
>a : any
//====let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00(x) {
>foo00 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
};
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//====const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00_c(x) {
>foo00_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}

View File

@@ -0,0 +1,518 @@
//// [capturedLetConstInLoop5_ES6.ts]
declare function use(a: any);
//====let
function foo0(x) {
for (let x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00(x) {
for (let x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
};
use(v)
}
function foo7(x) {
do {
let x, y;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//====const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00_c(x) {
for (const x in []) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
let x = 1;
(function() { return x + v });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v)
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1)
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function() { return x + y + v });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//// [capturedLetConstInLoop5_ES6.js]
//====let
function foo0(x) {
for (let x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00(x) {
for (let x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1(x) {
for (let x = 0; x < 1; ++x) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2(x) {
while (1 === 1) {
let x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3(x) {
do {
let x;
var v;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo4(x) {
for (let y = 0; y < 1; ++y) {
var v = y;
let x = 1;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5(x) {
for (let x = 0, y = 1; x < 1; ++x) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6(x) {
while (1 === 1) {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
;
use(v);
}
function foo7(x) {
do {
let x, y;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8(x) {
for (let y = 0; y < 1; ++y) {
let x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
//====const
function foo0_c(x) {
for (const x of []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo00_c(x) {
for (const x in []) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo1_c(x) {
for (const x = 0; x < 1;) {
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo2_c(x) {
while (1 === 1) {
const x = 1;
var v = x;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo3_c(x) {
do {
const x = 1;
var v;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo4_c(x) {
for (const y = 0; y < 1;) {
var v = y;
let x = 1;
(function () { return x + v; });
(() => x + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo5_c(x) {
for (const x = 0, y = 1; x < 1;) {
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo6_c(x) {
while (1 === 1) {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}
function foo7_c(x) {
do {
const x = 1, y = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
} while (1 === 1);
use(v);
}
function foo8_c(x) {
for (const y = 0; y < 1;) {
const x = 1;
var v = x;
(function () { return x + y + v; });
(() => x + y + v);
if (x == 1) {
return;
}
}
use(v);
}

View File

@@ -0,0 +1,683 @@
=== tests/cases/compiler/capturedLetConstInLoop5_ES6.ts ===
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>a : Symbol(a, Decl(capturedLetConstInLoop5_ES6.ts, 1, 21))
//====let
function foo0(x) {
>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop5_ES6.ts, 1, 29))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 14))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11))
}
function foo00(x) {
>foo00 : Symbol(foo00, Decl(capturedLetConstInLoop5_ES6.ts, 15, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 15))
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11))
}
function foo1(x) {
>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop5_ES6.ts, 28, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 14))
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11))
}
function foo2(x) {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop5_ES6.ts, 41, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 43, 14))
while (1 === 1) {
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11))
}
function foo3(x) {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop5_ES6.ts, 55, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 57, 14))
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11))
}
function foo4(x) {
>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop5_ES6.ts, 69, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 71, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11))
}
function foo5(x) {
>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop5_ES6.ts, 83, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 14))
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11))
}
function foo6(x) {
>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop5_ES6.ts, 96, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 99, 14))
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11))
return;
}
};
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11))
}
function foo7(x) {
>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop5_ES6.ts, 111, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 113, 14))
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11))
return;
}
} while (1 === 1);
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11))
}
function foo8(x) {
>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop5_ES6.ts, 125, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 128, 14))
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11))
}
//====const
function foo0_c(x) {
>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop5_ES6.ts, 140, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 16))
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11))
}
function foo00_c(x) {
>foo00_c : Symbol(foo00_c, Decl(capturedLetConstInLoop5_ES6.ts, 154, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 17))
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11))
}
function foo1_c(x) {
>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop5_ES6.ts, 167, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 16))
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11))
}
function foo2_c(x) {
>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop5_ES6.ts, 180, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 182, 16))
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11))
}
function foo3_c(x) {
>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop5_ES6.ts, 194, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 196, 16))
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
var v;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11))
}
function foo4_c(x) {
>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop5_ES6.ts, 208, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 210, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14))
var v = y;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
(function() { return x + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
(() => x + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11))
}
function foo5_c(x) {
>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop5_ES6.ts, 222, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 16))
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11))
}
function foo6_c(x) {
>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop5_ES6.ts, 235, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 238, 16))
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13))
return;
}
}
use(v)
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11))
}
function foo7_c(x) {
>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop5_ES6.ts, 250, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 252, 16))
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13))
return;
}
} while (1 === 1)
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11))
}
function foo8_c(x) {
>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop5_ES6.ts, 264, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 267, 16))
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
var v = x;
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
(function() { return x + y + v });
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
(() => x + y + v);
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13))
return;
}
}
use(v);
>use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0))
>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11))
}

View File

@@ -0,0 +1,952 @@
=== tests/cases/compiler/capturedLetConstInLoop5_ES6.ts ===
declare function use(a: any);
>use : (a: any) => any
>a : any
//====let
function foo0(x) {
>foo0 : (x: any) => void
>x : any
for (let x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00(x) {
>foo00 : (x: any) => void
>x : any
for (let x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1(x) {
>foo1 : (x: any) => void
>x : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2(x) {
>foo2 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3(x) {
>foo3 : (x: any) => void
>x : any
do {
let x;
>x : any
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4(x) {
>foo4 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5(x) {
>foo5 : (x: any) => void
>x : any
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6(x) {
>foo6 : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
};
use(v)
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo7(x) {
>foo7 : (x: any) => void
>x : any
do {
let x, y;
>x : any
>y : any
var v = x;
>v : any
>x : any
(function() { return x + y + v });
>(function() { return x + y + v }) : () => any
>function() { return x + y + v } : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
(() => x + y + v);
>(() => x + y + v) : () => any
>() => x + y + v : () => any
>x + y + v : any
>x + y : any
>x : any
>y : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
} while (1 === 1);
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo8(x) {
>foo8 : (x: any) => void
>x : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
//====const
function foo0_c(x) {
>foo0_c : (x: any) => void
>x : any
for (const x of []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo00_c(x) {
>foo00_c : (x: any) => void
>x : any
for (const x in []) {
>x : any
>[] : undefined[]
var v = x;
>v : any
>x : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : any
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : any
>v : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo1_c(x) {
>foo1_c : (x: any) => void
>x : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo2_c(x) {
>foo2_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo3_c(x) {
>foo3_c : (x: any) => void
>x : any
do {
const x = 1;
>x : number
>1 : number
var v;
>v : any
(function() { return x + v });
>(function() { return x + v }) : () => any
>function() { return x + v } : () => any
>x + v : any
>x : number
>v : any
(() => x + v);
>(() => x + v) : () => any
>() => x + v : () => any
>x + v : any
>x : number
>v : any
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : any
}
function foo4_c(x) {
>foo4_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
var v = y;
>v : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + v });
>(function() { return x + v }) : () => number
>function() { return x + v } : () => number
>x + v : number
>x : number
>v : number
(() => x + v);
>(() => x + v) : () => number
>() => x + v : () => number
>x + v : number
>x : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo5_c(x) {
>foo5_c : (x: any) => void
>x : any
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo6_c(x) {
>foo6_c : (x: any) => void
>x : any
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v)
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo7_c(x) {
>foo7_c : (x: any) => void
>x : any
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}
function foo8_c(x) {
>foo8_c : (x: any) => void
>x : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
var v = x;
>v : number
>x : number
(function() { return x + y + v });
>(function() { return x + y + v }) : () => number
>function() { return x + y + v } : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
(() => x + y + v);
>(() => x + y + v) : () => number
>() => x + y + v : () => number
>x + y + v : number
>x + y : number
>x : number
>y : number
>v : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
return;
}
}
use(v);
>use(v) : any
>use : (a: any) => any
>v : number
}

View File

@@ -0,0 +1,557 @@
//// [capturedLetConstInLoop6.ts]
// ====let
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
// ====const
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
//// [capturedLetConstInLoop6.js]
// ====let
var _loop_1 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
var state_1 = _loop_1(x);
if (state_1 === "break") break;
if (state_1 === "continue") continue;
}
var _loop_2 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x in []) {
var state_2 = _loop_2(x);
if (state_2 === "break") break;
if (state_2 === "continue") continue;
}
var _loop_3 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0; x < 1; ++x) {
var state_3 = _loop_3(x);
if (state_3 === "break") break;
if (state_3 === "continue") continue;
}
var _loop_4 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_4 = _loop_4();
if (state_4 === "break") break;
if (state_4 === "continue") continue;
}
var _loop_5 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_5 = _loop_5();
if (state_5 === "break") break;
if (state_5 === "continue") continue;
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1; ++y) {
var state_6 = _loop_6(y);
if (state_6 === "break") break;
if (state_6 === "continue") continue;
}
var _loop_7 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0, y = 1; x < 1; ++x) {
var state_7 = _loop_7(x, y);
if (state_7 === "break") break;
if (state_7 === "continue") continue;
}
var _loop_8 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_8 = _loop_8();
if (state_8 === "break") break;
if (state_8 === "continue") continue;
}
var _loop_9 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_9 = _loop_9();
if (state_9 === "break") break;
if (state_9 === "continue") continue;
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1; ++y) {
var state_10 = _loop_10(y);
if (state_10 === "break") break;
if (state_10 === "continue") continue;
}
// ====const
var _loop_11 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
var state_11 = _loop_11(x);
if (state_11 === "break") break;
if (state_11 === "continue") continue;
}
var _loop_12 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x in []) {
var state_12 = _loop_12(x);
if (state_12 === "break") break;
if (state_12 === "continue") continue;
}
var _loop_13 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0; x < 1;) {
var state_13 = _loop_13(x);
if (state_13 === "break") break;
if (state_13 === "continue") continue;
}
var _loop_14 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_14 = _loop_14();
if (state_14 === "break") break;
if (state_14 === "continue") continue;
}
var _loop_15 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_15 = _loop_15();
if (state_15 === "break") break;
if (state_15 === "continue") continue;
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1;) {
var state_16 = _loop_16(y);
if (state_16 === "break") break;
if (state_16 === "continue") continue;
}
var _loop_17 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var x = 0, y = 1; x < 1;) {
var state_17 = _loop_17(x, y);
if (state_17 === "break") break;
if (state_17 === "continue") continue;
}
var _loop_18 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
while (1 === 1) {
var state_18 = _loop_18();
if (state_18 === "break") break;
if (state_18 === "continue") continue;
}
var _loop_19 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
do {
var state_19 = _loop_19();
if (state_19 === "break") break;
if (state_19 === "continue") continue;
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 2) {
return "continue";
}
};
for (var y = 0; y < 1;) {
var state_20 = _loop_20(y);
if (state_20 === "break") break;
if (state_20 === "continue") continue;
}

View File

@@ -0,0 +1,481 @@
=== tests/cases/compiler/capturedLetConstInLoop6.ts ===
// ====let
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 1, 8))
continue;
}
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 12, 8))
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 24, 8))
continue;
}
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 36, 7))
continue;
}
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 48, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 59, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 60, 7))
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 71, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 71, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 71, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 71, 8))
continue;
}
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 83, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 83, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 83, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 83, 7))
continue;
}
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 95, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 95, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 95, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 95, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 106, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 107, 7))
continue;
}
}
// ====const
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 120, 10))
continue;
}
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 131, 10))
continue;
}
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 143, 10))
continue;
}
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 155, 9))
continue;
}
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 167, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 178, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 178, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 179, 9))
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 190, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 190, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 190, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 190, 10))
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 202, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 202, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 202, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 202, 9))
continue;
}
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 214, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 214, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 214, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 214, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6.ts, 225, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6.ts, 226, 9))
continue;
}
}

View File

@@ -0,0 +1,729 @@
=== tests/cases/compiler/capturedLetConstInLoop6.ts ===
// ====let
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
// ====const
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}

View File

@@ -0,0 +1,455 @@
//// [capturedLetConstInLoop6_ES6.ts]
// ====let
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
// ====const
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
//// [capturedLetConstInLoop6_ES6.js]
// ====let
for (let x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0; x < 1; ++x) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
// ====const
for (const x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0; x < 1;) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}
do {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
} while (1 === 1);
for (const y = 0; y < 1;) {
const x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 2) {
continue;
}
}

View File

@@ -0,0 +1,481 @@
=== tests/cases/compiler/capturedLetConstInLoop6_ES6.ts ===
// ====let
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 1, 8))
continue;
}
}
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 12, 8))
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 24, 8))
continue;
}
}
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 36, 7))
continue;
}
}
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 48, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 59, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 59, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 60, 7))
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 71, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 71, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 71, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 71, 8))
continue;
}
}
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 83, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 83, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 83, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 83, 7))
continue;
}
}
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 95, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 95, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 95, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 95, 7))
continue;
}
} while (1 === 1)
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 106, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 107, 7))
continue;
}
}
// ====const
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 120, 10))
continue;
}
}
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 131, 10))
continue;
}
}
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 143, 10))
continue;
}
}
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 155, 9))
continue;
}
}
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 167, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 178, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 178, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 179, 9))
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 190, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 190, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 190, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 190, 10))
continue;
}
}
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 202, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 202, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 202, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 202, 9))
continue;
}
}
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 214, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 214, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 214, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 214, 9))
continue;
}
} while (1 === 1)
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop6_ES6.ts, 225, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
break;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop6_ES6.ts, 226, 9))
continue;
}
}

View File

@@ -0,0 +1,729 @@
=== tests/cases/compiler/capturedLetConstInLoop6_ES6.ts ===
// ====let
for (let x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x;
>x : any
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (let x = 0, y = 1; x < 1; ++x) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
do {
let x, y;
>x : any
>y : any
(function() { return x + y});
>(function() { return x + y}) : () => any
>function() { return x + y} : () => any
>x + y : any
>x : any
>y : any
(() => x + y);
>(() => x + y) : () => any
>() => x + y : () => any
>x + y : any
>x : any
>y : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
let x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
// ====const
for (const x of []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x in []) {
>x : any
>[] : undefined[]
(function() { return x});
>(function() { return x}) : () => any
>function() { return x} : () => any
>x : any
(() => x);
>(() => x) : () => any
>() => x : () => any
>x : any
if (x == 1) {
>x == 1 : boolean
>x : any
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : any
>2 : number
continue;
}
}
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x});
>(function() { return x}) : () => number
>function() { return x} : () => number
>x : number
(() => x);
>(() => x) : () => number
>() => x : () => number
>x : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
for (const x = 0, y = 1; x < 1;) {
>x : number
>0 : number
>y : number
>1 : number
>x < 1 : boolean
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}
do {
const x = 1, y = 1;
>x : number
>1 : number
>y : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
} while (1 === 1)
>1 === 1 : boolean
>1 : number
>1 : number
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
const x = 1;
>x : number
>1 : number
(function() { return x + y});
>(function() { return x + y}) : () => number
>function() { return x + y} : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
}

View File

@@ -0,0 +1,894 @@
//// [capturedLetConstInLoop7.ts]
//===let
l0:
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0;
}
}
l00:
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
}
l2:
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2;
}
}
l3:
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6;
}
}
l7:
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0_c;
}
}
l00_c:
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2_c;
}
}
l3_c:
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8_c;
}
}
//// [capturedLetConstInLoop7.js]
//===let
var _loop_1 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l0";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l0";
}
};
l0: for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
var state_1 = _loop_1(x);
if (state_1 === "break") break;
if (state_1 === "continue") continue;
switch(state_1) {
case "break-l0": break l0;
case "continue-l0": continue l0;
}
}
var _loop_2 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l00";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l00";
}
};
l00: for (var x in []) {
var state_2 = _loop_2(x);
if (state_2 === "break") break;
if (state_2 === "continue") continue;
switch(state_2) {
case "break-l00": break l00;
case "continue-l00": continue l00;
}
}
var _loop_3 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
};
l1: for (var x = 0; x < 1; ++x) {
var state_3 = _loop_3(x);
if (state_3 === "break") break;
if (state_3 === "continue") continue;
switch(state_3) {
case "break-l1": break l1;
case "continue-l1": continue l1;
}
}
var _loop_4 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l2";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l2";
}
};
l2: while (1 === 1) {
var state_4 = _loop_4();
if (state_4 === "break") break;
if (state_4 === "continue") continue;
switch(state_4) {
case "break-l2": break l2;
case "continue-l2": continue l2;
}
}
var _loop_5 = function() {
var x = void 0;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l3";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l3";
}
};
l3: do {
var state_5 = _loop_5();
if (state_5 === "break") break;
if (state_5 === "continue") continue;
switch(state_5) {
case "break-l3": break l3;
case "continue-l3": continue l3;
}
} while (1 === 1);
var _loop_6 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l4";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l4";
}
};
l4: for (var y = 0; y < 1; ++y) {
var state_6 = _loop_6(y);
if (state_6 === "break") break;
if (state_6 === "continue") continue;
switch(state_6) {
case "break-l4": break l4;
case "continue-l4": continue l4;
}
}
var _loop_7 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l5";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l5";
}
};
l5: for (var x = 0, y = 1; x < 1; ++x) {
var state_7 = _loop_7(x, y);
if (state_7 === "break") break;
if (state_7 === "continue") continue;
switch(state_7) {
case "break-l5": break l5;
case "continue-l5": continue l5;
}
}
var _loop_8 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l6";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l6";
}
};
l6: while (1 === 1) {
var state_8 = _loop_8();
if (state_8 === "break") break;
if (state_8 === "continue") continue;
switch(state_8) {
case "break-l6": break l6;
case "continue-l6": continue l6;
}
}
var _loop_9 = function() {
var x = void 0, y = void 0;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l7";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l7";
}
};
l7: do {
var state_9 = _loop_9();
if (state_9 === "break") break;
if (state_9 === "continue") continue;
switch(state_9) {
case "break-l7": break l7;
case "continue-l7": continue l7;
}
} while (1 === 1);
var _loop_10 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l8";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l8";
}
};
l8: for (var y = 0; y < 1; ++y) {
var state_10 = _loop_10(y);
if (state_10 === "break") break;
if (state_10 === "continue") continue;
switch(state_10) {
case "break-l8": break l8;
case "continue-l8": continue l8;
}
}
//===const
var _loop_11 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l0_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l0_c";
}
};
l0_c: for (var _b = 0, _c = []; _b < _c.length; _b++) {
var x = _c[_b];
var state_11 = _loop_11(x);
if (state_11 === "break") break;
if (state_11 === "continue") continue;
switch(state_11) {
case "break-l0_c": break l0_c;
case "continue-l0_c": continue l0_c;
}
}
var _loop_12 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l00_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l00_c";
}
};
l00_c: for (var x in []) {
var state_12 = _loop_12(x);
if (state_12 === "break") break;
if (state_12 === "continue") continue;
switch(state_12) {
case "break-l00_c": break l00_c;
case "continue-l00_c": continue l00_c;
}
}
var _loop_13 = function(x) {
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1_c";
}
};
l1_c: for (var x = 0; x < 1;) {
var state_13 = _loop_13(x);
if (state_13 === "break") break;
if (state_13 === "continue") continue;
switch(state_13) {
case "break-l1_c": break l1_c;
case "continue-l1_c": continue l1_c;
}
}
var _loop_14 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l2_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l2_c";
}
};
l2_c: while (1 === 1) {
var state_14 = _loop_14();
if (state_14 === "break") break;
if (state_14 === "continue") continue;
switch(state_14) {
case "break-l2_c": break l2_c;
case "continue-l2_c": continue l2_c;
}
}
var _loop_15 = function() {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l3_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l3_c";
}
};
l3_c: do {
var state_15 = _loop_15();
if (state_15 === "break") break;
if (state_15 === "continue") continue;
switch(state_15) {
case "break-l3_c": break l3_c;
case "continue-l3_c": continue l3_c;
}
} while (1 === 1);
var _loop_16 = function(y) {
var x = 1;
(function () { return x; });
(function () { return x; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l4_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l4_c";
}
};
l4_c: for (var y = 0; y < 1;) {
var state_16 = _loop_16(y);
if (state_16 === "break") break;
if (state_16 === "continue") continue;
switch(state_16) {
case "break-l4_c": break l4_c;
case "continue-l4_c": continue l4_c;
}
}
var _loop_17 = function(x, y) {
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l5_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l5_c";
}
};
l5_c: for (var x = 0, y = 1; x < 1;) {
var state_17 = _loop_17(x, y);
if (state_17 === "break") break;
if (state_17 === "continue") continue;
switch(state_17) {
case "break-l5_c": break l5_c;
case "continue-l5_c": continue l5_c;
}
}
var _loop_18 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l6_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l6_c";
}
};
l6_c: while (1 === 1) {
var state_18 = _loop_18();
if (state_18 === "break") break;
if (state_18 === "continue") continue;
switch(state_18) {
case "break-l6_c": break l6_c;
case "continue-l6_c": continue l6_c;
}
}
var _loop_19 = function() {
var x = 1, y = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l7_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l7_c";
}
};
l7_c: do {
var state_19 = _loop_19();
if (state_19 === "break") break;
if (state_19 === "continue") continue;
switch(state_19) {
case "break-l7_c": break l7_c;
case "continue-l7_c": continue l7_c;
}
} while (1 === 1);
var _loop_20 = function(y) {
var x = 1;
(function () { return x + y; });
(function () { return x + y; });
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l8_c";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l8_c";
}
};
l8_c: for (var y = 0; y < 1;) {
var state_20 = _loop_20(y);
if (state_20 === "break") break;
if (state_20 === "continue") continue;
switch(state_20) {
case "break-l8_c": break l8_c;
case "continue-l8_c": continue l8_c;
}
}

View File

@@ -0,0 +1,698 @@
=== tests/cases/compiler/capturedLetConstInLoop7.ts ===
//===let
l0:
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
break l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 2, 8))
continue l0;
}
}
l00:
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
break l00;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 20, 8))
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 38, 8))
continue l1;
}
}
l2:
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
break l2;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 57, 7))
continue l2;
}
}
l3:
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
break l3;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 76, 7))
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 94, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
break l4;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 95, 7))
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 113, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 113, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 113, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
break l5;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 113, 8))
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 132, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 132, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 132, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
break l6;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 132, 7))
continue l6;
}
}
l7:
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 152, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 152, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 152, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
break l7;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 152, 7))
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 170, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
break l8;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 171, 7))
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
break l0_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 190, 10))
continue l0_c;
}
}
l00_c:
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
break l00_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 208, 10))
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
break l1_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 226, 10))
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
break l2_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 245, 9))
continue l2_c;
}
}
l3_c:
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
break l3_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 264, 9))
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 282, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 282, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
break l4_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 283, 9))
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 301, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 301, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 301, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
break l5_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 301, 10))
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 320, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 320, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 320, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
break l6_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 320, 9))
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 340, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 340, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 340, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
break l7_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 340, 9))
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7.ts, 358, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
break l8_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7.ts, 359, 9))
continue l8_c;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,712 @@
//// [capturedLetConstInLoop7_ES6.ts]
//===let
l0:
for (let x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0;
}
}
l00:
for (let x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
}
l2:
while (1 === 1) {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2;
}
}
l3:
do {
let x;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6;
}
}
l7:
do {
let x, y;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
let x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0_c;
}
}
l00_c:
for (const x in []) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2_c;
}
}
l3_c:
do {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x});
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
const x = 1;
(function() { return x + y});
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8_c;
}
}
//// [capturedLetConstInLoop7_ES6.js]
//===let
l0: for (let x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0;
}
}
l00: for (let x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00;
}
}
l1: for (let x = 0; x < 1; ++x) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
}
l2: while (1 === 1) {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2;
}
}
l3: do {
let x;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3;
}
} while (1 === 1);
l4: for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4;
}
}
l5: for (let x = 0, y = 1; x < 1; ++x) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5;
}
}
l6: while (1 === 1) {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6;
}
}
l7: do {
let x, y;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7;
}
} while (1 === 1);
l8: for (let y = 0; y < 1; ++y) {
let x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8;
}
}
//===const
l0_c: for (const x of []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l0_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l0_c;
}
}
l00_c: for (const x in []) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l00_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l00_c;
}
}
l1_c: for (const x = 0; x < 1;) {
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l1_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1_c;
}
}
l2_c: while (1 === 1) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l2_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l2_c;
}
}
l3_c: do {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l3_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l3_c;
}
} while (1 === 1);
l4_c: for (const y = 0; y < 1;) {
const x = 1;
(function () { return x; });
(() => x);
if (x == 1) {
break;
}
if (x == 1) {
break l4_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l4_c;
}
}
l5_c: for (const x = 0, y = 1; x < 1;) {
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l5_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l5_c;
}
}
l6_c: while (1 === 1) {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l6_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l6_c;
}
}
l7_c: do {
const x = 1, y = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l7_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l7_c;
}
} while (1 === 1);
l8_c: for (const y = 0; y < 1;) {
const x = 1;
(function () { return x + y; });
(() => x + y);
if (x == 1) {
break;
}
if (x == 1) {
break l8_c;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l8_c;
}
}

View File

@@ -0,0 +1,698 @@
=== tests/cases/compiler/capturedLetConstInLoop7_ES6.ts ===
//===let
l0:
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
break l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 2, 8))
continue l0;
}
}
l00:
for (let x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
break l00;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 20, 8))
continue l00;
}
}
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 38, 8))
continue l1;
}
}
l2:
while (1 === 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
break l2;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 57, 7))
continue l2;
}
}
l3:
do {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
break l3;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 76, 7))
continue l3;
}
} while (1 === 1)
l4:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 94, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 94, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
break l4;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 95, 7))
continue l4;
}
}
l5:
for (let x = 0, y = 1; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 113, 15))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 113, 15))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 113, 15))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
break l5;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 113, 8))
continue l5;
}
}
l6:
while (1 === 1) {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 132, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 132, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 132, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
break l6;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 132, 7))
continue l6;
}
}
l7:
do {
let x, y;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 152, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 152, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 152, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
break l7;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 152, 7))
continue l7;
}
} while (1 === 1)
l8:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
let x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 170, 8))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
break l8;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 171, 7))
continue l8;
}
}
//===const
l0_c:
for (const x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
break l0_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 190, 10))
continue l0_c;
}
}
l00_c:
for (const x in []) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
break l00_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 208, 10))
continue l00_c;
}
}
l1_c:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
break l1_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 226, 10))
continue l1_c;
}
}
l2_c:
while (1 === 1) {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
break l2_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 245, 9))
continue l2_c;
}
}
l3_c:
do {
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
break l3_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 264, 9))
continue l3_c;
}
} while (1 === 1)
l4_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 282, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 282, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
(function() { return x});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
(() => x);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
break l4_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 283, 9))
continue l4_c;
}
}
l5_c:
for (const x = 0, y = 1; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 301, 17))
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 301, 17))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 301, 17))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
break l5_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 301, 10))
continue l5_c;
}
}
l6_c:
while (1 === 1) {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 320, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 320, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 320, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
break l6_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 320, 9))
continue l6_c;
}
}
l7_c:
do {
const x = 1, y = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 340, 16))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 340, 16))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 340, 16))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
break l7_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 340, 9))
continue l7_c;
}
} while (1 === 1)
l8_c:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
const x = 1;
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
(function() { return x + y});
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
>y : Symbol(y, Decl(capturedLetConstInLoop7_ES6.ts, 358, 10))
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
break l8_c;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop7_ES6.ts, 359, 9))
continue l8_c;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,293 @@
//// [capturedLetConstInLoop8.ts]
function foo() {
l0:
for (let z = 0; z < 1; ++z) {
l1:
for (let x = 0; x < 1; ++x) {
ll1:
for (let y = 0; y < 1; ++y) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
function foo_c() {
l0:
for (const z = 0; z < 1;) {
l1:
for (const x = 0; x < 1;) {
ll1:
for (const y = 0; y < 1;) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
//// [capturedLetConstInLoop8.js]
function foo() {
l0: for (var z = 0; z < 1; ++z) {
var _loop_1 = function(x) {
var _loop_2 = function(y) {
(function () { return x + y; });
(function () { return x + y; });
if (y == 1) {
return "break";
}
if (y == 1) {
return "break-l1";
}
if (y == 1) {
return "break-ll1";
}
if (y == 1) {
return "continue-l0";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-ll1";
}
if (x == 2) {
return { value: "123" };
}
if (x == 3) {
return { value: void 0 };
}
};
ll1: for (var y = 0; y < 1; ++y) {
var state_1 = _loop_2(y);
if (typeof state_1 === "object") return state_1;
if (state_1 === "break") break;
if (state_1 === "continue") continue;
switch(state_1) {
case "break-l1": return state_1;
case "break-ll1": break ll1;
case "continue-l0": return state_1;
case "continue-l1": return state_1;
case "continue-ll1": continue ll1;
}
}
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-l0";
}
if (x == 2) {
return { value: "456" };
}
if (x == 3) {
return { value: void 0 };
}
};
l1: for (var x = 0; x < 1; ++x) {
var state_2 = _loop_1(x);
if (typeof state_2 === "object") return state_2.value
if (state_2 === "break") break;
if (state_2 === "continue") continue;
switch(state_2) {
case "break-l1": break l1;
case "continue-l0": continue l0;
case "continue-l1": continue l1;
}
}
}
}
function foo_c() {
l0: for (var z = 0; z < 1;) {
var _loop_3 = function(x) {
var _loop_4 = function(y) {
(function () { return x + y; });
(function () { return x + y; });
if (y == 1) {
return "break";
}
if (y == 1) {
return "break-l1";
}
if (y == 1) {
return "break-ll1";
}
if (y == 1) {
return "continue-l0";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-ll1";
}
if (x == 2) {
return { value: "123" };
}
if (x == 3) {
return { value: void 0 };
}
};
ll1: for (var y = 0; y < 1;) {
var state_3 = _loop_4(y);
if (typeof state_3 === "object") return state_3;
if (state_3 === "break") break;
if (state_3 === "continue") continue;
switch(state_3) {
case "break-l1": return state_3;
case "break-ll1": break ll1;
case "continue-l0": return state_3;
case "continue-l1": return state_3;
case "continue-ll1": continue ll1;
}
}
if (x == 1) {
return "break";
}
if (x == 1) {
return "break-l1";
}
if (x == 2) {
return "continue";
}
if (x == 2) {
return "continue-l1";
}
if (x == 2) {
return "continue-l0";
}
if (x == 2) {
return { value: "456" };
}
if (x == 3) {
return { value: void 0 };
}
};
l1: for (var x = 0; x < 1;) {
var state_4 = _loop_3(x);
if (typeof state_4 === "object") return state_4.value
if (state_4 === "break") break;
if (state_4 === "continue") continue;
switch(state_4) {
case "break-l1": break l1;
case "continue-l0": continue l0;
case "continue-l1": continue l1;
}
}
}
}

View File

@@ -0,0 +1,228 @@
=== tests/cases/compiler/capturedLetConstInLoop8.ts ===
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop8.ts, 0, 0))
l0:
for (let z = 0; z < 1; ++z) {
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 2, 12))
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
ll1:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 6, 20))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 4, 16))
return;
}
}
}
}
function foo_c() {
>foo_c : Symbol(foo_c, Decl(capturedLetConstInLoop8.ts, 61, 1))
l0:
for (const z = 0; z < 1;) {
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 65, 14))
>z : Symbol(z, Decl(capturedLetConstInLoop8.ts, 65, 14))
l1:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
ll1:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8.ts, 69, 22))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8.ts, 67, 18))
return;
}
}
}
}

View File

@@ -0,0 +1,357 @@
=== tests/cases/compiler/capturedLetConstInLoop8.ts ===
function foo() {
>foo : () => string
l0:
>l0 : any
for (let z = 0; z < 1; ++z) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
>++z : number
>z : number
l1:
>l1 : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
ll1:
>ll1 : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}
function foo_c() {
>foo_c : () => string
l0:
>l0 : any
for (const z = 0; z < 1;) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
l1:
>l1 : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
ll1:
>ll1 : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}

View File

@@ -0,0 +1,245 @@
//// [capturedLetConstInLoop8_ES6.ts]
function foo() {
l0:
for (let z = 0; z < 1; ++z) {
l1:
for (let x = 0; x < 1; ++x) {
ll1:
for (let y = 0; y < 1; ++y) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
function foo_c() {
l0:
for (const z = 0; z < 1;) {
l1:
for (const x = 0; x < 1;) {
ll1:
for (const y = 0; y < 1;) {
(function() { return x + y });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123"
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
//// [capturedLetConstInLoop8_ES6.js]
function foo() {
l0: for (let z = 0; z < 1; ++z) {
l1: for (let x = 0; x < 1; ++x) {
ll1: for (let y = 0; y < 1; ++y) {
(function () { return x + y; });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123";
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}
function foo_c() {
l0: for (const z = 0; z < 1;) {
l1: for (const x = 0; x < 1;) {
ll1: for (const y = 0; y < 1;) {
(function () { return x + y; });
(() => x + y);
if (y == 1) {
break;
}
if (y == 1) {
break l1;
}
if (y == 1) {
break ll1;
}
if (y == 1) {
continue l0;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue ll1;
}
if (x == 2) {
return "123";
}
if (x == 3) {
return;
}
}
if (x == 1) {
break;
}
if (x == 1) {
break l1;
}
if (x == 2) {
continue;
}
if (x == 2) {
continue l1;
}
if (x == 2) {
continue l0;
}
if (x == 2) {
return "456";
}
if (x == 3) {
return;
}
}
}
}

View File

@@ -0,0 +1,228 @@
=== tests/cases/compiler/capturedLetConstInLoop8_ES6.ts ===
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop8_ES6.ts, 0, 0))
l0:
for (let z = 0; z < 1; ++z) {
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 2, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 2, 12))
l1:
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
ll1:
for (let y = 0; y < 1; ++y) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 6, 20))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 4, 16))
return;
}
}
}
}
function foo_c() {
>foo_c : Symbol(foo_c, Decl(capturedLetConstInLoop8_ES6.ts, 61, 1))
l0:
for (const z = 0; z < 1;) {
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 65, 14))
>z : Symbol(z, Decl(capturedLetConstInLoop8_ES6.ts, 65, 14))
l1:
for (const x = 0; x < 1;) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
ll1:
for (const y = 0; y < 1;) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
(function() { return x + y });
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
(() => x + y);
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
break;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
break l1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
break ll1;
}
if (y == 1) {
>y : Symbol(y, Decl(capturedLetConstInLoop8_ES6.ts, 69, 22))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue ll1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return "123"
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return;
}
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
break;
}
if (x == 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
break l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue l1;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
continue l0;
}
if (x == 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return "456";
}
if (x == 3) {
>x : Symbol(x, Decl(capturedLetConstInLoop8_ES6.ts, 67, 18))
return;
}
}
}
}

View File

@@ -0,0 +1,357 @@
=== tests/cases/compiler/capturedLetConstInLoop8_ES6.ts ===
function foo() {
>foo : () => string
l0:
>l0 : any
for (let z = 0; z < 1; ++z) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
>++z : number
>z : number
l1:
>l1 : any
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
ll1:
>ll1 : any
for (let y = 0; y < 1; ++y) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
>++y : number
>y : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}
function foo_c() {
>foo_c : () => string
l0:
>l0 : any
for (const z = 0; z < 1;) {
>z : number
>0 : number
>z < 1 : boolean
>z : number
>1 : number
l1:
>l1 : any
for (const x = 0; x < 1;) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
ll1:
>ll1 : any
for (const y = 0; y < 1;) {
>y : number
>0 : number
>y < 1 : boolean
>y : number
>1 : number
(function() { return x + y });
>(function() { return x + y }) : () => number
>function() { return x + y } : () => number
>x + y : number
>x : number
>y : number
(() => x + y);
>(() => x + y) : () => number
>() => x + y : () => number
>x + y : number
>x : number
>y : number
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break;
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break l1;
>l1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
break ll1;
>ll1 : any
}
if (y == 1) {
>y == 1 : boolean
>y : number
>1 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue ll1;
>ll1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "123"
>"123" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break;
}
if (x == 1) {
>x == 1 : boolean
>x : number
>1 : number
break l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue;
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l1;
>l1 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
continue l0;
>l0 : any
}
if (x == 2) {
>x == 2 : boolean
>x : number
>2 : number
return "456";
>"456" : string
}
if (x == 3) {
>x == 3 : boolean
>x : number
>3 : number
return;
}
}
}
}

View File

@@ -0,0 +1,296 @@
//// [capturedLetConstInLoop9.ts]
for (let x = 0; x < 1; ++x) {
let x;
(function() { return x });
{
let x;
(function() { return x });
}
try { }
catch (e) {
let x;
(function() { return x });
}
switch (x) {
case 1:
let x;
(function() { return x });
break;
}
while (1 == 1) {
let x;
(function() { return x });
}
class A {
m() {
return x + 1;
}
}
}
declare function use(a: any);
function foo() {
l0:
for (let a of []) {
if (a === 1) {
break;
}
if (a === 2) {
break l0;
}
for (let b of []) {
var [{x, y:z}] = [{x:1, y:2}];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
l1:
if (b === 3) {
break l1;
}
return 50;
}
for (let b of []) {
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
return 100;
() => b
}
() => a;
}
use(x);
use(z);
use(x1);
use(z1);
}
function foo2() {
for (let x of []) {
if (x === 1) {
break;
}
else if (x === 2) {
continue;
}
while (1 === 1) {
if (x) {
break;
}
else {
continue;
}
}
switch(x) {
case 1: break;
case 2: continue;
}
for (let y of []) {
switch(y) {
case 1: break;
case 2: continue;
}
}
}
}
class C {
constructor(private N: number) { }
foo() {
for (let i = 0; i < 100; i++) {
let f = () => this.N * i;
}
}
}
function foo3 () {
let x = arguments.length;
for (let y of []) {
let z = arguments.length;
(function() { return y + z + arguments.length; });
}
}
//// [capturedLetConstInLoop9.js]
var _loop_1 = function(x) {
var x_1 = void 0;
(function () { return x_1; });
{
var x_2 = void 0;
(function () { return x_2; });
}
try { }
catch (e) {
var x_3 = void 0;
(function () { return x_3; });
}
switch (x_1) {
case 1:
var x_4 = void 0;
(function () { return x_4; });
break;
}
var _loop_2 = function() {
var x_5 = void 0;
(function () { return x_5; });
};
while (1 == 1) {
_loop_2();
}
var A = (function () {
function A() {
}
A.prototype.m = function () {
return x_1 + 1;
};
return A;
})();
};
for (var x = 0; x < 1; ++x) {
_loop_1(x);
}
function foo() {
var _loop_3 = function(a) {
if (a === 1) {
return "break";
}
if (a === 2) {
return "break-l0";
}
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var b = _a[_i];
_b = [{ x: 1, y: 2 }][0], x = _b.x, z = _b.y;
if (b === 1) {
break;
}
if (b === 2) {
return "break-l0";
}
l1: if (b === 3) {
break l1;
}
return { value: 50 };
}
var _loop_4 = function(b) {
_c = [{ x1: 1, y: arguments_1.length }][0], x1 = _c.x1, z1 = _c.y;
if (b === 1) {
return "break";
}
if (b === 2) {
return "break-l0";
}
return { value: 100 };
(function () { return b; });
};
for (var _d = 0, _e = []; _d < _e.length; _d++) {
var b = _e[_d];
var state_3 = _loop_4(b);
if (typeof state_3 === "object") return state_3;
if (state_3 === "break") break;
switch(state_3) {
case "break-l0": return state_3;
}
}
(function () { return a; });
};
var arguments_1 = arguments;
var x, z, x1, z1;
l0: for (var _f = 0, _g = []; _f < _g.length; _f++) {
var a = _g[_f];
var state_4 = _loop_3(a);
if (typeof state_4 === "object") return state_4.value
if (state_4 === "break") break;
switch(state_4) {
case "break-l0": break l0;
}
}
use(x);
use(z);
use(x1);
use(z1);
}
function foo2() {
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var x = _a[_i];
if (x === 1) {
break;
}
else if (x === 2) {
continue;
}
while (1 === 1) {
if (x) {
break;
}
else {
continue;
}
}
switch (x) {
case 1: break;
case 2: continue;
}
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var y = _c[_b];
switch (y) {
case 1: break;
case 2: continue;
}
}
}
}
var C = (function () {
function C(N) {
this.N = N;
}
C.prototype.foo = function () {
var _this = this;
var _loop_5 = function(i) {
var f = function () { return _this.N * i; };
};
for (var i = 0; i < 100; i++) {
_loop_5(i);
}
};
return C;
})();
function foo3() {
var x = arguments.length;
var _loop_6 = function(y) {
var z = arguments_2.length;
(function () { return y + z + arguments.length; });
};
var arguments_2 = arguments;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var y = _a[_i];
_loop_6(y);
}
}

View File

@@ -0,0 +1,270 @@
=== tests/cases/compiler/capturedLetConstInLoop9.ts ===
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 0, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 0, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 0, 8))
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
{
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 4, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 4, 11))
}
try { }
catch (e) {
>e : Symbol(e, Decl(capturedLetConstInLoop9.ts, 9, 11))
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 10, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 10, 11))
}
switch (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
case 1:
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 16, 15))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 16, 15))
break;
}
while (1 == 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 22, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 22, 11))
}
class A {
>A : Symbol(A, Decl(capturedLetConstInLoop9.ts, 24, 5))
m() {
>m : Symbol(m, Decl(capturedLetConstInLoop9.ts, 26, 13))
return x + 1;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 1, 7))
}
}
}
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 33, 21))
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 33, 29))
l0:
for (let a of []) {
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
if (a === 1) {
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
break;
}
if (a === 2) {
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
break l0;
}
for (let b of []) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
var [{x, y:z}] = [{x:1, y:2}];
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 48, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 48, 35))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 48, 20))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 48, 31))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 48, 35))
if (b === 1) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
break;
}
if (b === 2) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
break l0;
}
l1:
if (b === 3) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 47, 16))
break l1;
}
return 50;
}
for (let b of []) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9.ts, 67, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 67, 38))
>z1 : Symbol(z1, Decl(capturedLetConstInLoop9.ts, 67, 21))
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9.ts, 67, 33))
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 67, 38))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
if (b === 1) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
break;
}
if (b === 2) {
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
break l0;
}
return 100;
() => b
>b : Symbol(b, Decl(capturedLetConstInLoop9.ts, 66, 16))
}
() => a;
>a : Symbol(a, Decl(capturedLetConstInLoop9.ts, 37, 12))
}
use(x);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 48, 18))
use(z);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 48, 20))
use(x1);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9.ts, 67, 18))
use(z1);
>use : Symbol(use, Decl(capturedLetConstInLoop9.ts, 31, 1))
>z1 : Symbol(z1, Decl(capturedLetConstInLoop9.ts, 67, 21))
}
function foo2() {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9.ts, 89, 1))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
if (x === 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
break;
}
else if (x === 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
continue;
}
while (1 === 1) {
if (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
break;
}
else {
continue;
}
}
switch(x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 92, 12))
case 1: break;
case 2: continue;
}
for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
switch(y) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 114, 16))
case 1: break;
case 2: continue;
}
}
}
}
class C {
>C : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
constructor(private N: number) { }
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9.ts, 124, 38))
for (let i = 0; i < 100; i++) {
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
let f = () => this.N * i;
>f : Symbol(f, Decl(capturedLetConstInLoop9.ts, 127, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9.ts, 121, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9.ts, 124, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9.ts, 126, 16))
}
}
}
function foo3 () {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9.ts, 130, 1))
let x = arguments.length;
>x : Symbol(x, Decl(capturedLetConstInLoop9.ts, 133, 7))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
let z = arguments.length;
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return y + z + arguments.length; });
>y : Symbol(y, Decl(capturedLetConstInLoop9.ts, 134, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9.ts, 135, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
}
}

View File

@@ -0,0 +1,359 @@
=== tests/cases/compiler/capturedLetConstInLoop9.ts ===
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
{
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
try { }
catch (e) {
>e : any
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
switch (x) {
>x : any
case 1:
>1 : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
break;
}
while (1 == 1) {
>1 == 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
class A {
>A : A
m() {
>m : () => any
return x + 1;
>x + 1 : any
>x : any
>1 : number
}
}
}
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo() {
>foo : () => number
l0:
>l0 : any
for (let a of []) {
>a : any
>[] : undefined[]
if (a === 1) {
>a === 1 : boolean
>a : any
>1 : number
break;
}
if (a === 2) {
>a === 2 : boolean
>a : any
>2 : number
break l0;
>l0 : any
}
for (let b of []) {
>b : any
>[] : undefined[]
var [{x, y:z}] = [{x:1, y:2}];
>x : number
>y : any
>z : number
>[{x:1, y:2}] : [{ x: number; y: number; }]
>{x:1, y:2} : { x: number; y: number; }
>x : number
>1 : number
>y : number
>2 : number
if (b === 1) {
>b === 1 : boolean
>b : any
>1 : number
break;
}
if (b === 2) {
>b === 2 : boolean
>b : any
>2 : number
break l0;
>l0 : any
}
l1:
>l1 : any
if (b === 3) {
>b === 3 : boolean
>b : any
>3 : number
break l1;
>l1 : any
}
return 50;
>50 : number
}
for (let b of []) {
>b : any
>[] : undefined[]
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
>x1 : number
>y : any
>z1 : number
>[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }]
>{x1:1, y:arguments.length} : { x1: number; y: number; }
>x1 : number
>1 : number
>y : number
>arguments.length : number
>arguments : IArguments
>length : number
if (b === 1) {
>b === 1 : boolean
>b : any
>1 : number
break;
}
if (b === 2) {
>b === 2 : boolean
>b : any
>2 : number
break l0;
>l0 : any
}
return 100;
>100 : number
() => b
>() => b : () => any
>b : any
}
() => a;
>() => a : () => any
>a : any
}
use(x);
>use(x) : any
>use : (a: any) => any
>x : number
use(z);
>use(z) : any
>use : (a: any) => any
>z : number
use(x1);
>use(x1) : any
>use : (a: any) => any
>x1 : number
use(z1);
>use(z1) : any
>use : (a: any) => any
>z1 : number
}
function foo2() {
>foo2 : () => void
for (let x of []) {
>x : any
>[] : undefined[]
if (x === 1) {
>x === 1 : boolean
>x : any
>1 : number
break;
}
else if (x === 2) {
>x === 2 : boolean
>x : any
>2 : number
continue;
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
if (x) {
>x : any
break;
}
else {
continue;
}
}
switch(x) {
>x : any
case 1: break;
>1 : number
case 2: continue;
>2 : number
}
for (let y of []) {
>y : any
>[] : undefined[]
switch(y) {
>y : any
case 1: break;
>1 : number
case 2: continue;
>2 : number
}
}
}
}
class C {
>C : C
constructor(private N: number) { }
>N : number
foo() {
>foo : () => void
for (let i = 0; i < 100; i++) {
>i : number
>0 : number
>i < 100 : boolean
>i : number
>100 : number
>i++ : number
>i : number
let f = () => this.N * i;
>f : () => number
>() => this.N * i : () => number
>this.N * i : number
>this.N : number
>this : this
>N : number
>i : number
}
}
}
function foo3 () {
>foo3 : () => void
let x = arguments.length;
>x : number
>arguments.length : number
>arguments : IArguments
>length : number
for (let y of []) {
>y : any
>[] : undefined[]
let z = arguments.length;
>z : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return y + z + arguments.length; });
>(function() { return y + z + arguments.length; }) : () => any
>function() { return y + z + arguments.length; } : () => any
>y + z + arguments.length : any
>y + z : any
>y : any
>z : number
>arguments.length : number
>arguments : IArguments
>length : number
}
}

View File

@@ -0,0 +1,255 @@
//// [capturedLetConstInLoop9_ES6.ts]
for (let x = 0; x < 1; ++x) {
let x;
(function() { return x });
{
let x;
(function() { return x });
}
try { }
catch (e) {
let x;
(function() { return x });
}
switch (x) {
case 1:
let x;
(function() { return x });
break;
}
while (1 == 1) {
let x;
(function() { return x });
}
class A {
m() {
return x + 1;
}
}
}
declare function use(a: any);
function foo() {
l0:
for (let a of []) {
if (a === 1) {
break;
}
if (a === 2) {
break l0;
}
for (let b of []) {
var [{x, y:z}] = [{x:1, y:2}];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
l1:
if (b === 3) {
break l1;
}
return 50;
}
for (let b of []) {
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
return 100;
() => b
}
() => a;
}
use(x);
use(z);
use(x1);
use(z1);
}
function foo2() {
for (let x of []) {
if (x === 1) {
break;
}
else if (x === 2) {
continue;
}
while (1 === 1) {
if (x) {
break;
}
else {
continue;
}
}
switch(x) {
case 1: break;
case 2: continue;
}
for (let y of []) {
switch(y) {
case 1: break;
case 2: continue;
}
}
}
}
class C {
constructor(private N: number) { }
foo() {
for (let i = 0; i < 100; i++) {
let f = () => this.N * i;
}
}
}
function foo3 () {
let x = arguments.length;
for (let y of []) {
let z = arguments.length;
(function() { return y + z + arguments.length; });
}
}
//// [capturedLetConstInLoop9_ES6.js]
for (let x = 0; x < 1; ++x) {
let x;
(function () { return x; });
{
let x;
(function () { return x; });
}
try { }
catch (e) {
let x;
(function () { return x; });
}
switch (x) {
case 1:
let x;
(function () { return x; });
break;
}
while (1 == 1) {
let x;
(function () { return x; });
}
class A {
m() {
return x + 1;
}
}
}
function foo() {
l0: for (let a of []) {
if (a === 1) {
break;
}
if (a === 2) {
break l0;
}
for (let b of []) {
var [{ x, y: z }] = [{ x: 1, y: 2 }];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
l1: if (b === 3) {
break l1;
}
return 50;
}
for (let b of []) {
var [{ x1, y: z1 }] = [{ x1: 1, y: arguments.length }];
if (b === 1) {
break;
}
if (b === 2) {
break l0;
}
return 100;
(() => b);
}
(() => a);
}
use(x);
use(z);
use(x1);
use(z1);
}
function foo2() {
for (let x of []) {
if (x === 1) {
break;
}
else if (x === 2) {
continue;
}
while (1 === 1) {
if (x) {
break;
}
else {
continue;
}
}
switch (x) {
case 1: break;
case 2: continue;
}
for (let y of []) {
switch (y) {
case 1: break;
case 2: continue;
}
}
}
}
class C {
constructor(N) {
this.N = N;
}
foo() {
for (let i = 0; i < 100; i++) {
let f = () => this.N * i;
}
}
}
function foo3() {
let x = arguments.length;
for (let y of []) {
let z = arguments.length;
(function () { return y + z + arguments.length; });
}
}

View File

@@ -0,0 +1,271 @@
=== tests/cases/compiler/capturedLetConstInLoop9_ES6.ts ===
for (let x = 0; x < 1; ++x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 1, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 1, 8))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 1, 8))
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 2, 7))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 2, 7))
{
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 5, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 5, 11))
}
try { }
catch (e) {
>e : Symbol(e, Decl(capturedLetConstInLoop9_ES6.ts, 10, 11))
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 11, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 11, 11))
}
switch (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 2, 7))
case 1:
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 17, 15))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 17, 15))
break;
}
while (1 == 1) {
let x;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 23, 11))
(function() { return x });
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 23, 11))
}
class A {
>A : Symbol(A, Decl(capturedLetConstInLoop9_ES6.ts, 25, 5))
m() {
>m : Symbol(m, Decl(capturedLetConstInLoop9_ES6.ts, 27, 13))
return x + 1;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 2, 7))
}
}
}
declare function use(a: any);
>use : Symbol(use, Decl(capturedLetConstInLoop9_ES6.ts, 32, 1))
>a : Symbol(a, Decl(capturedLetConstInLoop9_ES6.ts, 34, 21))
function foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9_ES6.ts, 34, 29))
l0:
for (let a of []) {
>a : Symbol(a, Decl(capturedLetConstInLoop9_ES6.ts, 38, 12))
if (a === 1) {
>a : Symbol(a, Decl(capturedLetConstInLoop9_ES6.ts, 38, 12))
break;
}
if (a === 2) {
>a : Symbol(a, Decl(capturedLetConstInLoop9_ES6.ts, 38, 12))
break l0;
}
for (let b of []) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 48, 16))
var [{x, y:z}] = [{x:1, y:2}];
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 49, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 49, 35))
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 49, 20))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 49, 31))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 49, 35))
if (b === 1) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 48, 16))
break;
}
if (b === 2) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 48, 16))
break l0;
}
l1:
if (b === 3) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 48, 16))
break l1;
}
return 50;
}
for (let b of []) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 67, 16))
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9_ES6.ts, 68, 18))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 68, 38))
>z1 : Symbol(z1, Decl(capturedLetConstInLoop9_ES6.ts, 68, 21))
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9_ES6.ts, 68, 33))
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 68, 38))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
if (b === 1) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 67, 16))
break;
}
if (b === 2) {
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 67, 16))
break l0;
}
return 100;
() => b
>b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 67, 16))
}
() => a;
>a : Symbol(a, Decl(capturedLetConstInLoop9_ES6.ts, 38, 12))
}
use(x);
>use : Symbol(use, Decl(capturedLetConstInLoop9_ES6.ts, 32, 1))
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 49, 18))
use(z);
>use : Symbol(use, Decl(capturedLetConstInLoop9_ES6.ts, 32, 1))
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 49, 20))
use(x1);
>use : Symbol(use, Decl(capturedLetConstInLoop9_ES6.ts, 32, 1))
>x1 : Symbol(x1, Decl(capturedLetConstInLoop9_ES6.ts, 68, 18))
use(z1);
>use : Symbol(use, Decl(capturedLetConstInLoop9_ES6.ts, 32, 1))
>z1 : Symbol(z1, Decl(capturedLetConstInLoop9_ES6.ts, 68, 21))
}
function foo2() {
>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop9_ES6.ts, 90, 1))
for (let x of []) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
if (x === 1) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
break;
}
else if (x === 2) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
continue;
}
while (1 === 1) {
if (x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
break;
}
else {
continue;
}
}
switch(x) {
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 93, 12))
case 1: break;
case 2: continue;
}
for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 115, 16))
switch(y) {
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 115, 16))
case 1: break;
case 2: continue;
}
}
}
}
class C {
>C : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 122, 1))
constructor(private N: number) { }
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
foo() {
>foo : Symbol(foo, Decl(capturedLetConstInLoop9_ES6.ts, 125, 38))
for (let i = 0; i < 100; i++) {
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
let f = () => this.N * i;
>f : Symbol(f, Decl(capturedLetConstInLoop9_ES6.ts, 128, 15))
>this.N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>this : Symbol(C, Decl(capturedLetConstInLoop9_ES6.ts, 122, 1))
>N : Symbol(N, Decl(capturedLetConstInLoop9_ES6.ts, 125, 16))
>i : Symbol(i, Decl(capturedLetConstInLoop9_ES6.ts, 127, 16))
}
}
}
function foo3 () {
>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop9_ES6.ts, 131, 1))
let x = arguments.length;
>x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 134, 7))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
for (let y of []) {
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 135, 12))
let z = arguments.length;
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 136, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
(function() { return y + z + arguments.length; });
>y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 135, 12))
>z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 136, 11))
>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
>arguments : Symbol(arguments)
>length : Symbol(IArguments.length, Decl(lib.d.ts, --, --))
}
}

View File

@@ -0,0 +1,360 @@
=== tests/cases/compiler/capturedLetConstInLoop9_ES6.ts ===
for (let x = 0; x < 1; ++x) {
>x : number
>0 : number
>x < 1 : boolean
>x : number
>1 : number
>++x : number
>x : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
{
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
try { }
catch (e) {
>e : any
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
switch (x) {
>x : any
case 1:
>1 : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
break;
}
while (1 == 1) {
>1 == 1 : boolean
>1 : number
>1 : number
let x;
>x : any
(function() { return x });
>(function() { return x }) : () => any
>function() { return x } : () => any
>x : any
}
class A {
>A : A
m() {
>m : () => any
return x + 1;
>x + 1 : any
>x : any
>1 : number
}
}
}
declare function use(a: any);
>use : (a: any) => any
>a : any
function foo() {
>foo : () => number
l0:
>l0 : any
for (let a of []) {
>a : any
>[] : undefined[]
if (a === 1) {
>a === 1 : boolean
>a : any
>1 : number
break;
}
if (a === 2) {
>a === 2 : boolean
>a : any
>2 : number
break l0;
>l0 : any
}
for (let b of []) {
>b : any
>[] : undefined[]
var [{x, y:z}] = [{x:1, y:2}];
>x : number
>y : any
>z : number
>[{x:1, y:2}] : [{ x: number; y: number; }]
>{x:1, y:2} : { x: number; y: number; }
>x : number
>1 : number
>y : number
>2 : number
if (b === 1) {
>b === 1 : boolean
>b : any
>1 : number
break;
}
if (b === 2) {
>b === 2 : boolean
>b : any
>2 : number
break l0;
>l0 : any
}
l1:
>l1 : any
if (b === 3) {
>b === 3 : boolean
>b : any
>3 : number
break l1;
>l1 : any
}
return 50;
>50 : number
}
for (let b of []) {
>b : any
>[] : undefined[]
var [{x1, y:z1}] = [{x1:1, y:arguments.length}];
>x1 : number
>y : any
>z1 : number
>[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }]
>{x1:1, y:arguments.length} : { x1: number; y: number; }
>x1 : number
>1 : number
>y : number
>arguments.length : number
>arguments : IArguments
>length : number
if (b === 1) {
>b === 1 : boolean
>b : any
>1 : number
break;
}
if (b === 2) {
>b === 2 : boolean
>b : any
>2 : number
break l0;
>l0 : any
}
return 100;
>100 : number
() => b
>() => b : () => any
>b : any
}
() => a;
>() => a : () => any
>a : any
}
use(x);
>use(x) : any
>use : (a: any) => any
>x : number
use(z);
>use(z) : any
>use : (a: any) => any
>z : number
use(x1);
>use(x1) : any
>use : (a: any) => any
>x1 : number
use(z1);
>use(z1) : any
>use : (a: any) => any
>z1 : number
}
function foo2() {
>foo2 : () => void
for (let x of []) {
>x : any
>[] : undefined[]
if (x === 1) {
>x === 1 : boolean
>x : any
>1 : number
break;
}
else if (x === 2) {
>x === 2 : boolean
>x : any
>2 : number
continue;
}
while (1 === 1) {
>1 === 1 : boolean
>1 : number
>1 : number
if (x) {
>x : any
break;
}
else {
continue;
}
}
switch(x) {
>x : any
case 1: break;
>1 : number
case 2: continue;
>2 : number
}
for (let y of []) {
>y : any
>[] : undefined[]
switch(y) {
>y : any
case 1: break;
>1 : number
case 2: continue;
>2 : number
}
}
}
}
class C {
>C : C
constructor(private N: number) { }
>N : number
foo() {
>foo : () => void
for (let i = 0; i < 100; i++) {
>i : number
>0 : number
>i < 100 : boolean
>i : number
>100 : number
>i++ : number
>i : number
let f = () => this.N * i;
>f : () => number
>() => this.N * i : () => number
>this.N * i : number
>this.N : number
>this : this
>N : number
>i : number
}
}
}
function foo3 () {
>foo3 : () => void
let x = arguments.length;
>x : number
>arguments.length : number
>arguments : IArguments
>length : number
for (let y of []) {
>y : any
>[] : undefined[]
let z = arguments.length;
>z : number
>arguments.length : number
>arguments : IArguments
>length : number
(function() { return y + z + arguments.length; });
>(function() { return y + z + arguments.length; }) : () => any
>function() { return y + z + arguments.length; } : () => any
>y + z + arguments.length : any
>y + z : any
>y : any
>z : number
>arguments.length : number
>arguments : IArguments
>length : number
}
}

View File

@@ -1,60 +1,39 @@
tests/cases/compiler/downlevelLetConst18.ts(3,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
tests/cases/compiler/downlevelLetConst18.ts(4,14): error TS2393: Duplicate function implementation.
tests/cases/compiler/downlevelLetConst18.ts(7,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
tests/cases/compiler/downlevelLetConst18.ts(8,14): error TS2393: Duplicate function implementation.
tests/cases/compiler/downlevelLetConst18.ts(11,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
tests/cases/compiler/downlevelLetConst18.ts(15,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
tests/cases/compiler/downlevelLetConst18.ts(19,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
tests/cases/compiler/downlevelLetConst18.ts(23,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
tests/cases/compiler/downlevelLetConst18.ts(27,1): error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
==== tests/cases/compiler/downlevelLetConst18.ts (9 errors) ====
==== tests/cases/compiler/downlevelLetConst18.ts (2 errors) ====
'use strict'
for (let x; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
function foo() { x };
~~~
!!! error TS2393: Duplicate function implementation.
}
for (let x; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
function foo() { x };
~~~
!!! error TS2393: Duplicate function implementation.
}
for (let x; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
(() => { x })();
}
for (const x = 1; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
(() => { x })();
}
for (let x; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
({ foo() { x }})
}
for (let x; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
({ get foo() { return x } })
}
for (let x; ;) {
~~~
!!! error TS4091: Loop contains block-scoped variable 'x' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher.
({ set foo(v) { x } })
}

View File

@@ -32,26 +32,47 @@ for (let x; ;) {
//// [downlevelLetConst18.js]
'use strict';
for (var x = void 0;;) {
var _loop_1 = function(x) {
function foo() { x; }
;
}
};
for (var x = void 0;;) {
_loop_1(x);
}
var _loop_2 = function(x) {
function foo() { x; }
;
}
};
for (var x = void 0;;) {
_loop_2(x);
}
var _loop_3 = function(x) {
(function () { x; })();
};
for (var x = void 0;;) {
_loop_3(x);
}
var _loop_4 = function(x) {
(function () { x; })();
};
for (var x = 1;;) {
(function () { x; })();
_loop_4(x);
}
for (var x = void 0;;) {
var _loop_5 = function(x) {
({ foo: function () { x; } });
}
};
for (var x = void 0;;) {
_loop_5(x);
}
var _loop_6 = function(x) {
({ get foo() { return x; } });
}
};
for (var x = void 0;;) {
({ set foo(v) { x; } });
_loop_6(x);
}
var _loop_7 = function(x) {
({ set foo(v) { x; } });
};
for (var x = void 0;;) {
_loop_7(x);
}