rename colliding let bindings with for loop init (#8937)

* rename colliding let bindings with for loop init

* added complex test case to check if loop init collisions were handled correctly

* updated test files
This commit is contained in:
Byron Luk
2018-10-31 12:28:36 -07:00
committed by Nicolò Ribaudo
parent c82750a48a
commit 0d9e77f559
6 changed files with 49 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
for (let a, { b } = {};;) {
let a, { b } = {};
{
let a, { b } = {};
}
}

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-destructuring", "transform-block-scoping"]
}

View File

@@ -0,0 +1,11 @@
for (var a, _ref = {}, b = _ref.b;;) {
var _a = void 0,
_ref2 = {},
_b = _ref2.b;
{
var _a2 = void 0,
_ref3 = {},
_b2 = _ref3.b;
}
}

View File

@@ -0,0 +1,8 @@
for (let i = 0; i < 3; i++) {
let i = 'abc';
console.log(i);
{
let i = "hello";
}
}

View File

@@ -0,0 +1,7 @@
for (var i = 0; i < 3; i++) {
var _i = 'abc';
console.log(_i);
{
var _i2 = "hello";
}
}