Comparing version 0.4.16 to 0.4.17
# buble changelog | ||
## 0.4.17 | ||
* Support `for...in` loops and block scoping | ||
## 0.4.16 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "buble", | ||
"version": "0.4.16", | ||
"version": "0.4.17", | ||
"description": "The blazing fast, batteries-included ES2015 compiler", | ||
@@ -5,0 +5,0 @@ "main": "dist/buble.umd.js", |
@@ -7,2 +7,3 @@ import { walk } from 'estree-walker'; | ||
ForStatement: 'body', | ||
ForInStatement: 'body', | ||
WhileStatement: 'body', | ||
@@ -9,0 +10,0 @@ ArrowFunctionExpression: 'body' |
@@ -6,3 +6,3 @@ import Node from '../Node.js'; | ||
initialise ( transforms ) { | ||
this.loop = this.findNearest( /(?:For|While)Statement/ ); | ||
this.loop = this.findNearest( /(?:For(?:In)?|While)Statement/ ); | ||
this.loop.canBreak = true; | ||
@@ -9,0 +9,0 @@ } |
@@ -6,3 +6,3 @@ import Node from '../Node.js'; | ||
transpile ( code, transforms ) { | ||
const loop = this.findNearest( /(?:For|While)Statement/ ); | ||
const loop = this.findNearest( /(?:For(?:In)?|While)Statement/ ); | ||
if ( loop.shouldRewriteAsFunction ) { | ||
@@ -9,0 +9,0 @@ if ( this.label ) throw new CompileError( this, 'Labels are not currently supported in a loop with locally-scoped variables' ); |
@@ -12,2 +12,3 @@ import ArrayExpression from './ArrayExpression.js'; | ||
import ForStatement from './ForStatement.js'; | ||
import ForInStatement from './ForInStatement.js'; | ||
import ForOfStatement from './ForOfStatement.js'; | ||
@@ -46,2 +47,3 @@ import FunctionDeclaration from './FunctionDeclaration.js'; | ||
ForStatement, | ||
ForInStatement, | ||
ForOfStatement, | ||
@@ -48,0 +50,0 @@ FunctionDeclaration, |
@@ -5,3 +5,3 @@ import Node from '../Node.js'; | ||
initialise ( transforms ) { | ||
this.loop = this.findNearest( /(?:For|While)Statement/ ); | ||
this.loop = this.findNearest( /(?:For(?:In)?|While)Statement/ ); | ||
this.nearestFunction = this.findNearest( /Function/ ); | ||
@@ -8,0 +8,0 @@ |
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
1909874
56
16357