diff --git a/packages/ast-utils/src/reference.ts b/packages/ast-utils/src/reference.ts index 5882fc07..e252fede 100644 --- a/packages/ast-utils/src/reference.ts +++ b/packages/ast-utils/src/reference.ts @@ -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 diff --git a/packages/unminify/src/transformations/__tests__/smart-rename.spec.ts b/packages/unminify/src/transformations/__tests__/smart-rename.spec.ts index df40d94e..8cbce79c 100644 --- a/packages/unminify/src/transformations/__tests__/smart-rename.spec.ts +++ b/packages/unminify/src/transformations/__tests__/smart-rename.spec.ts @@ -39,7 +39,7 @@ const foo2 = ({ dispatchers: o, listener: i }) => { - o.delete(t, i); + t[o].delete(i); } const foo3 = function ({ @@ -92,7 +92,7 @@ const foo2 = ({ dispatchers, listener }) => { - dispatchers.delete(gql, listener); + gql[dispatchers].delete(listener); } const foo3 = function ({