Skip to content

Commit

Permalink
fix(transformer): logical assignment operator transform: fix referenc…
Browse files Browse the repository at this point in the history
…e IDs (#6289)
  • Loading branch information
overlookmotel committed Oct 5, 2024
1 parent e19deaa commit 06797b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ impl<'a, 'ctx> LogicalAssignmentOperators<'a, 'ctx> {
}

// _o[_b]
let reference = ctx.symbols_mut().get_reference_mut(ident.reference_id().unwrap());
*reference.flags_mut() = ReferenceFlags::Read;
let assign_target = AssignmentTarget::from(ctx.ast.member_expression_computed(
SPAN,
ctx.ast.expression_from_identifier_reference(
ctx.clone_identifier_reference(&ident, ReferenceFlags::Read),
),
ctx.ast.expression_from_identifier_reference(ident),
property.map_or_else(
|| expression.clone_in(ctx.ast.allocator),
|ident| {
Expand Down
32 changes: 2 additions & 30 deletions tasks/transform_conformance/snapshots/babel.snap.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
commit: 3bcfee23

Passed: 333/1022
Passed: 336/1022

# All Passed:
* babel-plugin-transform-logical-assignment-operators
* babel-plugin-transform-optional-catch-binding
* babel-preset-react
* babel-plugin-transform-react-display-name
Expand Down Expand Up @@ -1440,35 +1441,6 @@ x Output mismatch
x Output mismatch


# babel-plugin-transform-logical-assignment-operators (3/6)
* logical-assignment/general-semantics/input.js
Symbol reference IDs mismatch for "_deep$obj5":
after transform: SymbolId(15): [ReferenceId(117), ReferenceId(118), ReferenceId(121)]
rebuilt : SymbolId(8): [ReferenceId(87), ReferenceId(91)]
Symbol reference IDs mismatch for "_deep$obj6":
after transform: SymbolId(17): [ReferenceId(122), ReferenceId(123), ReferenceId(126)]
rebuilt : SymbolId(10): [ReferenceId(99), ReferenceId(103)]
Symbol reference IDs mismatch for "_deep$obj7":
after transform: SymbolId(19): [ReferenceId(127), ReferenceId(128), ReferenceId(131)]
rebuilt : SymbolId(12): [ReferenceId(111), ReferenceId(115)]
Symbol reference IDs mismatch for "_deep$obj8":
after transform: SymbolId(21): [ReferenceId(132), ReferenceId(133), ReferenceId(136)]
rebuilt : SymbolId(14): [ReferenceId(123), ReferenceId(127)]

* logical-assignment/null-coalescing/input.js
Symbol reference IDs mismatch for "_deep$obj3":
after transform: SymbolId(17): [ReferenceId(86), ReferenceId(87), ReferenceId(90)]
rebuilt : SymbolId(10): [ReferenceId(73), ReferenceId(79)]
Symbol reference IDs mismatch for "_deep$obj4":
after transform: SymbolId(20): [ReferenceId(94), ReferenceId(95), ReferenceId(98)]
rebuilt : SymbolId(13): [ReferenceId(88), ReferenceId(94)]

* logical-assignment/null-coalescing-without-other/input.js
Symbol reference IDs mismatch for "_o2":
after transform: SymbolId(2): [ReferenceId(6), ReferenceId(7), ReferenceId(10)]
rebuilt : SymbolId(1): [ReferenceId(5), ReferenceId(8)]


# babel-plugin-transform-nullish-coalescing-operator (5/12)
* assumption-noDocumentAll/transform/input.js
x Output mismatch
Expand Down

0 comments on commit 06797b6

Please sign in to comment.