diff --git a/lib/6to5/transformation/transformers/es6-for-of.js b/lib/6to5/transformation/transformers/es6-for-of.js index 3eed21d15d..3e3f9ac0f3 100644 --- a/lib/6to5/transformation/transformers/es6-for-of.js +++ b/lib/6to5/transformation/transformers/es6-for-of.js @@ -30,6 +30,9 @@ exports.ForOfStatement = function (node, parent, scope, context, file) { // push the rest of the original loop body onto our new body block.body = block.body.concat(node.body.body); + // todo: find out why this is necessary? #538 + loop._scopeInfo = node._scopeInfo; + return loop; };