diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index af676612d5..49ec6b3959 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -195,7 +195,9 @@ Scope.prototype.register = function (node, reference, kind) { for (var key in ids) { var id = ids[key]; - if (kind !== "hoisted") this.checkBlockScopedCollisions(key, id); + if (kind !== "hoisted" && kind !== "param") { + this.checkBlockScopedCollisions(key, id); + } this.registerType(key, id, node); this.bindings[key] = id; @@ -274,10 +276,11 @@ Scope.prototype.crawl = function () { info = block._scopeInfo = { bindingKinds: { - "hoisted": object(), - "const": object(), - "var": object(), - "let": object() + hoisted: object(), + "const": object(), + param: object(), + "var": object(), + "let": object() }, references: object(), @@ -321,7 +324,7 @@ Scope.prototype.crawl = function () { if (t.isFunction(block)) { for (i = 0; i < block.params.length; i++) { - this.register(block.params[i], null, "let"); + this.register(block.params[i], null, "param"); } this.traverse(block.body, blockVariableVisitor, this); }