-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(transformer/nullish-coalescing): failing test (#8051)
Add failing test for nullish coalescing operator. The output is correct, but temp var is created in wrong scope. My guess is that it needs to use `current_hoist_scope_id`, not `current_scope_id`. This test from class properties also shows the same problem: https://github.com/oxc-project/oxc/blob/ac097e916051288cc982136e4e22c2766cb4bd91/tasks/transform_conformance/snapshots/oxc.snap.md?plain=1#L20-L35
- Loading branch information
1 parent
d69de36
commit 3d83396
Showing
3 changed files
with
21 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
3 changes: 3 additions & 0 deletions
3
...babel-plugin-transform-nullish-coalescing-operator/test/fixtures/in-nested-block/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,3 @@ | ||
{ | ||
x ?? y | ||
} |
4 changes: 4 additions & 0 deletions
4
...abel-plugin-transform-nullish-coalescing-operator/test/fixtures/in-nested-block/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,4 @@ | ||
{ | ||
var _x; | ||
(_x = x) !== null && _x !== void 0 ? _x : y; | ||
} |