Simplify scope.hasReferences implementation (#11368)

This commit is contained in:
Mateusz Burzyński 2020-04-04 00:44:44 +02:00 committed by GitHub
parent 051fc0a791
commit aeebc08234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {