diff --git a/packages/babel-plugin-transform-es2015-block-scoping/src/index.js b/packages/babel-plugin-transform-es2015-block-scoping/src/index.js index a5a1d45cd4..40275602dd 100644 --- a/packages/babel-plugin-transform-es2015-block-scoping/src/index.js +++ b/packages/babel-plugin-transform-es2015-block-scoping/src/index.js @@ -459,8 +459,8 @@ class BlockScoping { this.hoistVarDeclarations(); // turn outsideLetReferences into an array - const params = values(outsideRefs); const args = values(outsideRefs); + const params = args.map(id => t.clone(id)); const isSwitch = this.blockPath.isSwitchStatement(); diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/6025/expected.js b/packages/babel-preset-es2015/test/fixtures/preset-options/6025/expected.js index e0a1c0a0b9..798a5ae27b 100644 --- a/packages/babel-preset-es2015/test/fixtures/preset-options/6025/expected.js +++ b/packages/babel-preset-es2015/test/fixtures/preset-options/6025/expected.js @@ -12,9 +12,9 @@ var _iteratorError = undefined; try { for (var _iterator = c[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var path = _step.value; + var _path = _step.value; - _loop(path); + _loop(_path); } } catch (err) { _didIteratorError = true;