diff --git a/lib/6to5/traversal/scope.js b/lib/6to5/traversal/scope.js index 489c758b73..06e878382e 100644 --- a/lib/6to5/traversal/scope.js +++ b/lib/6to5/traversal/scope.js @@ -320,11 +320,12 @@ Scope.prototype.crawl = function () { for (i = 0; i < block.params.length; i++) { this.register(block.params[i]); } + this.traverse(block.body, blockVariableVisitor, this); } // Program, BlockStatement, Function - let variables - if (t.isBlockStatement(block) || t.isProgram(block) || t.isFunction(block)) { + if (t.isBlockStatement(block) || t.isProgram(block)) { this.traverse(block, blockVariableVisitor, this); }