Skip to content

Commit

Permalink
Fix reference in JSXIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Oct 25, 2024
1 parent 697bec4 commit 846fa32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/babel/core/deref-memo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export default function derefMemo(
}
for (const ref of binding.referencePaths) {
if (transformReferencePath(ref, readIdentifier)) {
assert(
t.isIdentifier(ref.node),
unexpectedType(ref, ref.node.type, 'Identifier'),
);
ref.replaceWith(t.callExpression(readIdentifier, []));
}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/core/babel/core/deref-signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ export default function derefSignal(
// Transform all reads
for (const ref of binding.referencePaths) {
if (transformSignalRead(ref, readIdentifier, writeIdentifier)) {
assert(
t.isIdentifier(ref.node),
unexpectedType(ref, ref.node.type, 'Identifier'),
);
ref.replaceWith(t.callExpression(readIdentifier, []));
}
}
Expand Down

0 comments on commit 846fa32

Please sign in to comment.