forked from babel/babel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix replacing for-of if inside label (babel#4736)
This replaces the label instead of the for-of itself as we already integrate the label in the replacement nodes. Fixes babel#3858
- Loading branch information
1 parent
e4eca7c
commit 0097463
Showing
6 changed files
with
31 additions
and
1 deletion.
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
5 changes: 5 additions & 0 deletions
5
...bel-plugin-transform-es2015-for-of/test/fixtures/regression/if-block-label-3858/actual.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,5 @@ | ||
if ( true ) { | ||
loop: for (let ch of []) { | ||
} | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
...l-plugin-transform-es2015-for-of/test/fixtures/regression/if-block-label-3858/expected.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 @@ | ||
if (true) { | ||
var _arr = []; | ||
|
||
loop: for (var _i = 0; _i < _arr.length; _i++) { | ||
let ch = _arr[_i]; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ges/babel-plugin-transform-es2015-for-of/test/fixtures/regression/if-label-3858/actual.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,4 @@ | ||
if ( true ) | ||
loop: for (let ch of []) { | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
...s/babel-plugin-transform-es2015-for-of/test/fixtures/regression/if-label-3858/expected.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 @@ | ||
if (true) { | ||
var _arr = []; | ||
|
||
loop: for (var _i = 0; _i < _arr.length; _i++) { | ||
let ch = _arr[_i]; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-es2015-for-of/test/fixtures/regression/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-es2015-for-of"] | ||
} |