register default globals as bindings

This commit is contained in:
Sebastian McKenzie 2015-02-14 19:08:41 +11:00
parent 84f54ca3c7
commit e1151e08c9

View File

@ -403,8 +403,6 @@ Scope.prototype.addGlobal = function (node) {
}; };
Scope.prototype.hasGlobal = function (name) { Scope.prototype.hasGlobal = function (name) {
if (includes(Scope.globals, name)) return true;
var scope = this; var scope = this;
do { do {
@ -639,6 +637,7 @@ Scope.prototype.hasBinding = function (name) {
if (!name) return false; if (!name) return false;
if (this.hasOwnBinding(name)) return true; if (this.hasOwnBinding(name)) return true;
if (this.parentHasBinding(name)) return true; if (this.parentHasBinding(name)) return true;
if (includes(Scope.globals, name)) return true;
return false; return false;
}; };