Skip to content

Commit

Permalink
test(transformer/nullish-coalescing): failing test (#8051)
Browse files Browse the repository at this point in the history
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
overlookmotel committed Dec 21, 2024
1 parent d69de36 commit 3d83396
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tasks/transform_conformance/snapshots/oxc.snap.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
commit: 54a8389f

Passed: 117/135
Passed: 117/136

# All Passed:
* babel-plugin-transform-class-static-block
* babel-plugin-transform-logical-assignment-operators
* babel-plugin-transform-nullish-coalescing-operator
* babel-plugin-transform-optional-catch-binding
* babel-plugin-transform-async-generator-functions
* babel-plugin-transform-object-rest-spread
Expand Down Expand Up @@ -56,6 +55,19 @@ after transform: SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(6), R
rebuilt : SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(6), ReferenceId(10)]


# babel-plugin-transform-nullish-coalescing-operator (2/3)
* in-nested-block/input.js
Bindings mismatch:
after transform: ScopeId(0): []
rebuilt : ScopeId(0): ["_x"]
Bindings mismatch:
after transform: ScopeId(1): ["_x"]
rebuilt : ScopeId(1): []
Symbol scope ID mismatch for "_x":
after transform: SymbolId(0): ScopeId(1)
rebuilt : SymbolId(0): ScopeId(0)


# babel-plugin-transform-async-to-generator (14/15)
* super/nested/input.js
x Output mismatch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
x ?? y
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
var _x;
(_x = x) !== null && _x !== void 0 ? _x : y;
}

0 comments on commit 3d83396

Please sign in to comment.