Comparing version 0.8.4 to 0.8.5
# buble changelog | ||
## 0.8.5 | ||
* Allow destructured parameter to have default ([#43](https://gitlab.com/Rich-Harris/buble/issues/43)) | ||
* Allow `continue`/`break` statements inside a for-of loop | ||
## 0.8.4 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "buble", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"description": "The blazing fast, batteries-included ES2015 compiler", | ||
@@ -5,0 +5,0 @@ "main": "dist/buble.umd.js", |
@@ -88,7 +88,2 @@ import wrap from './wrap.js'; | ||
if ( /Function/.test( this.parent.type ) ) { | ||
// default parameters | ||
if ( transforms.defaultParameter ) { | ||
this.transpileDefaultParameters( code, introStatementGenerators ); | ||
} | ||
// object pattern | ||
@@ -100,2 +95,7 @@ if ( transforms.parameterDestructuring ) { | ||
// default parameters | ||
if ( transforms.defaultParameter ) { | ||
this.transpileDefaultParameters( code, introStatementGenerators ); | ||
} | ||
// rest parameter | ||
@@ -209,4 +209,9 @@ if ( transforms.spreadRest ) { | ||
transpileObjectPattern ( code, introStatementGenerators ) { | ||
this.parent.params.filter( param => param.type === 'ObjectPattern' ).forEach( param => { | ||
const params = this.parent.params; | ||
const objectPatterns = params.filter( param => param.type === 'ObjectPattern' ); | ||
const assignmentPatterns = params.filter( param => param.type === 'AssignmentPattern' ) | ||
.map( exp => exp.left ).filter( param => param.type === 'ObjectPattern' ); | ||
[].concat(objectPatterns, assignmentPatterns).forEach( param => { | ||
const ref = this.scope.createIdentifier( 'ref' ); | ||
param.name = ref; | ||
code.insertRight( param.start, ref ); | ||
@@ -213,0 +218,0 @@ |
@@ -6,3 +6,3 @@ import Node from '../Node.js'; | ||
transpile ( code, transforms ) { | ||
const loop = this.findNearest( /(?:For(?:In)?|While)Statement/ ); | ||
const loop = this.findNearest( /(?:For(?:In|Of)?|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' ); |
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
1253773
11463