Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 6, 2021
1 parent ee7a9e8 commit a9335f3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/babel-types/src/validators/isReferenced.ts
Expand Up @@ -57,10 +57,8 @@ export default function isReferenced(
if (parent.key === node) {
return !!parent.computed;
}
if (parent.value === node) {
return !grandparent || grandparent.type !== "ObjectPattern";
}
return true;
// parent.value === node
return !grandparent || grandparent.type !== "ObjectPattern";
// no: class { NODE = value; }
// yes: class { [NODE] = value; }
// yes: class { key = NODE; }
Expand All @@ -70,10 +68,7 @@ export default function isReferenced(
}
return true;
case "ClassPrivateProperty":
if (parent.key === node) {
return false;
}
return true;
return parent.key !== node;

// no: class NODE {}
// yes: class Foo extends NODE {}
Expand Down

0 comments on commit a9335f3

Please sign in to comment.