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 { hasReference(name: string): boolean {
let scope = this; return !!this.getProgramParent().references[name];
do {
if (scope.references[name]) return true;
} while ((scope = scope.parent));
return false;
} }
isPure(node, constantsOnly?: boolean) { isPure(node, constantsOnly?: boolean) {