Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only extract IDs for TDZ checks in assign when necessary (#15164)
- Loading branch information
1 parent
4511a96
commit 9862d42
Showing
7 changed files
with
124 additions
and
67 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
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
2 changes: 2 additions & 0 deletions
2
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/simple-assign-no-tdz/exec.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,2 @@ | ||
let i | ||
i = 2; |
2 changes: 2 additions & 0 deletions
2
...ages/babel-plugin-transform-block-scoping/test/fixtures/tdz/simple-assign-no-tdz/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,2 @@ | ||
let i | ||
i = 2; |
2 changes: 2 additions & 0 deletions
2
...ges/babel-plugin-transform-block-scoping/test/fixtures/tdz/simple-assign-no-tdz/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,2 @@ | ||
var i; | ||
i = 2; |
13 changes: 13 additions & 0 deletions
13
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/update-expression/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,13 @@ | ||
maybeCallLater(function f() { | ||
x++; | ||
++x; | ||
x.p++; | ||
++x.p; | ||
}); | ||
|
||
x++; | ||
++x; | ||
x.p++; | ||
++x.p; | ||
|
||
let x; |
15 changes: 15 additions & 0 deletions
15
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/update-expression/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,15 @@ | ||
var x = babelHelpers.temporalUndefined; | ||
maybeCallLater(function f() { | ||
babelHelpers.temporalRef(x, "x") | ||
x++; | ||
babelHelpers.temporalRef(x, "x") | ||
++x; | ||
babelHelpers.temporalRef(x, "x").p++; | ||
++babelHelpers.temporalRef(x, "x").p; | ||
}); | ||
babelHelpers.tdz("x"); | ||
babelHelpers.tdz("x"); | ||
babelHelpers.tdz("x").p++; | ||
++babelHelpers.tdz("x").p; | ||
x = void 0; | ||
void 0; |