diff --git a/lib/6to5/transformation/transformers/es6/block-scoping.js b/lib/6to5/transformation/transformers/es6/block-scoping.js index 72a5bd4079..ff75035621 100644 --- a/lib/6to5/transformation/transformers/es6/block-scoping.js +++ b/lib/6to5/transformation/transformers/es6/block-scoping.js @@ -315,7 +315,7 @@ var loopVisitor = { return context.skip(); } - if (node && !node.label) { + if (node && !node.label && state.isLoop) { if (t.isBreakStatement(node)) { if (t.isSwitchCase(parent)) return; @@ -352,6 +352,7 @@ LetScoping.prototype.checkLoop = function () { hasContinue: false, hasReturn: false, hasBreak: false, + isLoop: !!this.loopParent }; traverse(this.block, loopVisitor, this.scope, state);