Skip to content

Commit

Permalink
Simplify scope.hasReferences implementation (#11368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Apr 3, 2020
1 parent 051fc0a commit aeebc08
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/babel-traverse/src/scope/index.js
Expand Up @@ -662,13 +662,7 @@ export default class Scope {
}

hasReference(name: string): boolean {
let scope = this;

do {
if (scope.references[name]) return true;
} while ((scope = scope.parent));

return false;
return !!this.getProgramParent().references[name];
}

isPure(node, constantsOnly?: boolean) {
Expand Down

0 comments on commit aeebc08

Please sign in to comment.