diff --git a/lib/6to5/transformation/file.js b/lib/6to5/transformation/file.js index 87086b3ff3..b41b853319 100644 --- a/lib/6to5/transformation/file.js +++ b/lib/6to5/transformation/file.js @@ -460,7 +460,7 @@ File.prototype.generateUid = function (name, scope) { File.prototype.generateUidIdentifier = function (name, scope) { scope = scope || this.scope; var id = t.identifier(this.generateUid(name, scope)); - scope.addBindingToFunctionScope(id); + scope.addBindingToFunctionScope(id, "uid"); return id; }; diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index 147e96ed17..286f460d4a 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -246,7 +246,7 @@ var programReferenceVisitor = { enter: function (node, parent, scope, state) { if (t.isReferencedIdentifier(node, parent) && !scope.hasReference(node.name)) { state.register(node, true); - } else if (t.isLabelStatemented(node)) { + } else if (t.isLabeledStatement(node)) { state.register(node.label, true); } } @@ -283,7 +283,8 @@ Scope.prototype.crawl = function () { "const": object(), param: object(), "var": object(), - "let": object() + "let": object(), + uid: object() }, references: object(),