Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
c82750a
commit 0d9e77f
Showing
6 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...block-scoping/test/fixtures/general/issue-8498-loop-init-collision-destructuring/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
for (let a, { b } = {};;) { | ||
let a, { b } = {}; | ||
|
||
{ | ||
let a, { b } = {}; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...k-scoping/test/fixtures/general/issue-8498-loop-init-collision-destructuring/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["transform-destructuring", "transform-block-scoping"] | ||
} |
11 changes: 11 additions & 0 deletions
11
...lock-scoping/test/fixtures/general/issue-8498-loop-init-collision-destructuring/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...gin-transform-block-scoping/test/fixtures/general/issue-8498-loop-init-collision/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
for (let i = 0; i < 3; i++) { | ||
let i = 'abc'; | ||
console.log(i); | ||
|
||
{ | ||
let i = "hello"; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...in-transform-block-scoping/test/fixtures/general/issue-8498-loop-init-collision/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
for (var i = 0; i < 3; i++) { | ||
var _i = 'abc'; | ||
console.log(_i); | ||
{ | ||
var _i2 = "hello"; | ||
} | ||
} |