From e1151e08c96aaba41e33b28aa59b96f48f8ae5b0 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 14 Feb 2015 19:08:41 +1100 Subject: [PATCH] register default globals as bindings --- lib/6to5/traversal/scope.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index c446a69f19..5b0d5d95c5 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -403,8 +403,6 @@ Scope.prototype.addGlobal = function (node) { }; Scope.prototype.hasGlobal = function (name) { - if (includes(Scope.globals, name)) return true; - var scope = this; do { @@ -639,6 +637,7 @@ Scope.prototype.hasBinding = function (name) { if (!name) return false; if (this.hasOwnBinding(name)) return true; if (this.parentHasBinding(name)) return true; + if (includes(Scope.globals, name)) return true; return false; };