Skip to content

Commit

Permalink
fix: reference should include computed property inside MemberExpression
Browse files Browse the repository at this point in the history
closes #135
  • Loading branch information
pionxzh committed Aug 10, 2024
1 parent 3d59d53 commit 7d3a3c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ast-utils/src/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function findReferences(
.filter(path => isVariableIdentifier(j, path))
.filter((path) => {
// ignore properties (e.g. in MemberExpression
if (path.name === 'property') return false
if (path.name === 'property' && j.MemberExpression.check(path.parent.node) && !path.parent.node.computed) return false

if (!path.scope) return false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const foo2 = ({
dispatchers: o,
listener: i
}) => {
o.delete(t, i);
t[o].delete(i);
}
const foo3 = function ({
Expand Down Expand Up @@ -92,7 +92,7 @@ const foo2 = ({
dispatchers,
listener
}) => {
dispatchers.delete(gql, listener);
gql[dispatchers].delete(listener);
}
const foo3 = function ({
Expand Down

0 comments on commit 7d3a3c2

Please sign in to comment.