Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix block scoping transform for declarations in labeled statements (#…
…4669) * Fix block scoping transform for declarations in labeled statements (#4122) * DRY block-scoping
- Loading branch information
Showing
3 changed files
with
37 additions
and
15 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
9 changes: 9 additions & 0 deletions
9
packages/babel-plugin-transform-es2015-block-scoping/test/fixtures/general/label/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,9 @@ | ||
let x, y; | ||
{ | ||
a: let x; | ||
let y; | ||
} | ||
|
||
switch (0) { | ||
case 0: a: let x=0; | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/babel-plugin-transform-es2015-block-scoping/test/fixtures/general/label/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,11 @@ | ||
var x = void 0, | ||
y = void 0; | ||
{ | ||
a: var _x = void 0; | ||
var _y = void 0; | ||
} | ||
|
||
switch (0) { | ||
case 0: | ||
a: var _x2 = 0; | ||
} |