Comparing version 0.4.17 to 0.4.18
# buble changelog | ||
## 0.4.18 | ||
* Fix break-inside-switch bug | ||
## 0.4.17 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "buble", | ||
"version": "0.4.17", | ||
"version": "0.4.18", | ||
"description": "The blazing fast, batteries-included ES2015 compiler", | ||
@@ -5,0 +5,0 @@ "main": "dist/buble.umd.js", |
@@ -1,2 +0,1 @@ | ||
import { walk } from 'estree-walker'; | ||
import wrap from './wrap.js'; | ||
@@ -3,0 +2,0 @@ |
@@ -6,8 +6,13 @@ import Node from '../Node.js'; | ||
initialise ( transforms ) { | ||
this.loop = this.findNearest( /(?:For(?:In)?|While)Statement/ ); | ||
this.loop.canBreak = true; | ||
const loop = this.findNearest( /(?:For(?:In)?|While)Statement/ ); | ||
const switchCase = this.findNearest( 'SwitchCase' ); | ||
if ( loop && ( !switchCase || loop.depth > switchCase.depth ) ) { | ||
loop.canBreak = true; | ||
this.loop = loop; | ||
} | ||
} | ||
transpile ( code, transforms ) { | ||
if ( this.loop.shouldRewriteAsFunction ) { | ||
if ( this.loop && this.loop.shouldRewriteAsFunction ) { | ||
if ( this.label ) throw new CompileError( this, 'Labels are not currently supported in a loop with locally-scoped variables' ); | ||
@@ -14,0 +19,0 @@ code.overwrite( this.start, this.start + 5, `return 'break'` ); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1915633
16405