diff --git a/src/babel/transformation/modules/system.js b/src/babel/transformation/modules/system.js index 7223c4f9ba..83813e670f 100644 --- a/src/babel/transformation/modules/system.js +++ b/src/babel/transformation/modules/system.js @@ -33,8 +33,7 @@ var hoistVariablesVisitor = { } // for (var i in test) - // for (var i = 0;;) - if (t.isFor(parent) && (parent.left === node || parent.init === node)) { + if (t.isFor(parent) && parent.left === node) { return node.declarations[0].id; } diff --git a/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/actual.js b/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/actual.js index 64ebb67787..86954f1cea 100644 --- a/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/actual.js +++ b/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/actual.js @@ -8,6 +8,8 @@ export var p = 5; for (var a in b) ; +for (var i = 0, j = 0;;) ; + export var isOdd = (function (isEven) { return function (n) { return !isEven(n); diff --git a/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/expected.js b/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/expected.js index 6e5381d373..4412e7284a 100644 --- a/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/expected.js +++ b/test/core/fixtures/transformation/es6.modules-system/hoist-function-exports/expected.js @@ -1,7 +1,7 @@ System.register(["./evens"], function (_export) { "use strict"; - var isEven, p, a, isOdd; + var isEven, p, a, i, j, isOdd; _export("nextOdd", nextOdd); @@ -20,6 +20,8 @@ System.register(["./evens"], function (_export) { for (a in b); + for (i = 0, j = 0;;); + isOdd = (function (isEven) { return function (n) { return !isEven(n);