simplify Scope::has
This commit is contained in:
parent
b1b326cf9c
commit
be55f42f80
@ -387,8 +387,11 @@ Scope.prototype.parentGet = function (id, decl) {
|
||||
*/
|
||||
|
||||
Scope.prototype.has = function (id, decl) {
|
||||
return (id && (this.hasOwn(id, decl) || this.parentHas(id, decl))) ||
|
||||
contains(Scope.defaultDeclarations, id);
|
||||
if (!id) return false;
|
||||
if (this.hasOwn(id, decl)) return true;
|
||||
if (this.parentHas(id, decl)) return true;
|
||||
if (contains(Scope.defaultDeclarations, id)) return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user