From 84f54ca3c739dc2e78b4da6f3697570a8a50a79a Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 14 Feb 2015 19:08:02 +1100 Subject: [PATCH] rename defaultDeclarations to globals --- lib/6to5/traversal/scope.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index d8190a282d..c446a69f19 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -33,7 +33,7 @@ function Scope(block, parentBlock, parent, file) { this.crawl(); } -Scope.defaultDeclarations = flatten([globals.builtin, globals.browser, globals.node].map(Object.keys)); +Scope.globals = flatten([globals.builtin, globals.browser, globals.node].map(Object.keys)); /** * Description @@ -403,6 +403,8 @@ Scope.prototype.addGlobal = function (node) { }; Scope.prototype.hasGlobal = function (name) { + if (includes(Scope.globals, name)) return true; + var scope = this; do { @@ -637,7 +639,6 @@ Scope.prototype.hasBinding = function (name) { if (!name) return false; if (this.hasOwnBinding(name)) return true; if (this.parentHasBinding(name)) return true; - if (includes(Scope.defaultDeclarations, name)) return true; return false; };