simplify Scope::has

This commit is contained in:
Sebastian McKenzie 2015-01-31 10:06:22 +11:00
parent b1b326cf9c
commit be55f42f80

View File

@ -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;
};
/**