Skip to content

Commit

Permalink
fix(transformer/nullish-coalescing-operator): incorrect reference flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Sep 3, 2024
1 parent cfe5497 commit 646ae35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl<'a> Traverse<'a> for NullishCoalescingOperator<'a> {

let left =
AssignmentTarget::from(ctx.ast.simple_assignment_target_from_identifier_reference(
ctx.clone_identifier_reference(&ident, ReferenceFlags::Write),
ctx.clone_identifier_reference(&ident, ReferenceFlags::read_write()),
));

let reference = ctx.ast.expression_from_identifier_reference(ident);
Expand Down
74 changes: 2 additions & 72 deletions tasks/transform_conformance/babel.snap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
commit: 3bcfee23

Passed: 314/1021
Passed: 317/1021

# All Passed:
* babel-plugin-transform-optional-catch-binding
Expand Down Expand Up @@ -1706,18 +1706,6 @@ failed to resolve query: failed to parse the rest of input: ...''
| ReferenceId(98)]
| rebuilt : SymbolId(14): [ReferenceId(88), ReferenceId(94)]

x Reference flags mismatch:
| after transform: ReferenceId(58): ReferenceFlags(Write)
| rebuilt : ReferenceId(6): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(62): ReferenceFlags(Write)
| rebuilt : ReferenceId(14): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(67): ReferenceFlags(Write)
| rebuilt : ReferenceId(26): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(65): ReferenceFlags(Write)
| rebuilt : ReferenceId(27): ReferenceFlags(Read | Write)
Expand All @@ -1726,10 +1714,6 @@ failed to resolve query: failed to parse the rest of input: ...''
| after transform: ReferenceId(64): ReferenceFlags(Write)
| rebuilt : ReferenceId(31): ReferenceFlags(Read)

x Reference flags mismatch:
| after transform: ReferenceId(72): ReferenceFlags(Write)
| rebuilt : ReferenceId(35): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(70): ReferenceFlags(Write)
| rebuilt : ReferenceId(36): ReferenceFlags(Read | Write)
Expand All @@ -1738,10 +1722,6 @@ failed to resolve query: failed to parse the rest of input: ...''
| after transform: ReferenceId(69): ReferenceFlags(Write)
| rebuilt : ReferenceId(40): ReferenceFlags(Read)

x Reference flags mismatch:
| after transform: ReferenceId(78): ReferenceFlags(Write)
| rebuilt : ReferenceId(46): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(76): ReferenceFlags(Write)
| rebuilt : ReferenceId(48): ReferenceFlags(Read | Write)
Expand All @@ -1750,10 +1730,6 @@ failed to resolve query: failed to parse the rest of input: ...''
| after transform: ReferenceId(74): ReferenceFlags(Write)
| rebuilt : ReferenceId(53): ReferenceFlags(Read)

x Reference flags mismatch:
| after transform: ReferenceId(84): ReferenceFlags(Write)
| rebuilt : ReferenceId(58): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(82): ReferenceFlags(Write)
| rebuilt : ReferenceId(60): ReferenceFlags(Read | Write)
Expand All @@ -1762,10 +1738,6 @@ failed to resolve query: failed to parse the rest of input: ...''
| after transform: ReferenceId(80): ReferenceFlags(Write)
| rebuilt : ReferenceId(65): ReferenceFlags(Read)

x Reference flags mismatch:
| after transform: ReferenceId(92): ReferenceFlags(Write)
| rebuilt : ReferenceId(72): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(87): ReferenceFlags(Write)
| rebuilt : ReferenceId(73): ReferenceFlags(Read | Write)
Expand All @@ -1778,10 +1750,6 @@ failed to resolve query: failed to parse the rest of input: ...''
| after transform: ReferenceId(88): ReferenceFlags(Write)
| rebuilt : ReferenceId(80): ReferenceFlags(Read)

x Reference flags mismatch:
| after transform: ReferenceId(100): ReferenceFlags(Write)
| rebuilt : ReferenceId(87): ReferenceFlags(Read | Write)

x Reference flags mismatch:
| after transform: ReferenceId(95): ReferenceFlags(Write)
| rebuilt : ReferenceId(88): ReferenceFlags(Read | Write)
Expand Down Expand Up @@ -1833,33 +1801,17 @@ failed to resolve query: failed to parse the rest of input: ...''



# babel-plugin-transform-nullish-coalescing-operator (2/12)
# babel-plugin-transform-nullish-coalescing-operator (5/12)
* assumption-noDocumentAll/transform/input.js
x Output mismatch
x Reference flags mismatch:
| after transform: ReferenceId(2): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* assumption-noDocumentAll/transform-in-default-destructuring/input.js
x Output mismatch
x Reference flags mismatch:
| after transform: ReferenceId(2): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* assumption-noDocumentAll/transform-in-default-param/input.js
x Output mismatch
x Reference flags mismatch:
| after transform: ReferenceId(3): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* assumption-noDocumentAll/transform-in-function/input.js
x Output mismatch
x Reference flags mismatch:
| after transform: ReferenceId(2): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* assumption-noDocumentAll/transform-static-refs-in-default/input.js
Expand All @@ -1868,29 +1820,7 @@ failed to resolve query: failed to parse the rest of input: ...''
* assumption-noDocumentAll/transform-static-refs-in-function/input.js


* nullish-coalescing/transform-in-default-destructuring/input.js
x Reference flags mismatch:
| after transform: ReferenceId(2): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* nullish-coalescing/transform-in-default-param/input.js
x Reference flags mismatch:
| after transform: ReferenceId(3): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* nullish-coalescing/transform-in-function/input.js
x Reference flags mismatch:
| after transform: ReferenceId(2): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* nullish-coalescing/transform-loose/input.js
x Output mismatch
x Reference flags mismatch:
| after transform: ReferenceId(2): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)



Expand Down
17 changes: 2 additions & 15 deletions tasks/transform_conformance/oxc.snap.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
commit: 3bcfee23

Passed: 11/41
Passed: 13/41

# All Passed:
* babel-plugin-transform-nullish-coalescing-operator
* babel-plugin-transform-optional-catch-binding
* babel-preset-typescript


# babel-plugin-transform-nullish-coalescing-operator (0/2)
* invalid-variable-name/input.js
x Reference flags mismatch:
| after transform: ReferenceId(3): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)


* transform-in-arrow-function-expression/input.js
x Reference flags mismatch:
| after transform: ReferenceId(3): ReferenceFlags(Write)
| rebuilt : ReferenceId(0): ReferenceFlags(Read | Write)



# babel-plugin-transform-arrow-functions (1/2)
* with-this-member-expression/input.jsx
x Unresolved references mismatch:
Expand Down

0 comments on commit 646ae35

Please sign in to comment.