Skip to content

Commit

Permalink
Simplify derefSignal
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Oct 25, 2024
1 parent 79f1b13 commit f4e9dd2
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 243 deletions.
8 changes: 4 additions & 4 deletions packages/core/babel/core/deref-memo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function transformGetter(
const key = propertyParent.node.key;
assert(
t.isExpression(key),
unexpectedType(propertyParent, key.type, 'Identifier'),
unexpectedType(propertyParent.get('key'), key.type, 'Identifier'),
);
const objectParent = getProperParentPath(
propertyParent,
Expand All @@ -47,9 +47,9 @@ function transformReferencePath(
if (!(trueCallee && CALL_CTF.has(trueCallee.name))) {
return true;
}
const rawArgs = parent.node.arguments[0];
const arg = unwrapNode(rawArgs, t.isIdentifier);
assert(arg, unexpectedType(parent, rawArgs.type, 'Identifier'));
const rawArgs = parent.get('arguments')[0];
const arg = unwrapNode(rawArgs.node, t.isIdentifier);
assert(arg, unexpectedType(rawArgs, rawArgs.type, 'Identifier'));
if (arg !== ref.node) {
return true;
}
Expand Down
Loading

0 comments on commit f4e9dd2

Please sign in to comment.