Simplify scope.hasReferences implementation (#11368)
This commit is contained in:
parent
051fc0a791
commit
aeebc08234
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user