Comparing version 0.5.7 to 0.5.8
# buble changelog | ||
## 0.5.8 | ||
* Fix exponentiation assignment operator edge case | ||
## 0.5.7 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "buble", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "The blazing fast, batteries-included ES2015 compiler", | ||
@@ -5,0 +5,0 @@ "main": "dist/buble.umd.js", |
@@ -39,3 +39,3 @@ import Node from '../Node.js'; | ||
// how we do the next part depends on a number of factors – whether | ||
// how we do the next part depends on a number of factors – whether | ||
// this is a top-level statement, and whether we're updating a | ||
@@ -55,3 +55,2 @@ // simple or complex reference | ||
let needsPropertyVar = false; | ||
let dotProperty = false; | ||
@@ -63,3 +62,2 @@ const statement = this.findNearest( /(?:Statement|Declaration)$/ ); | ||
property = left.computed ? getAlias( left.property.name ) : left.property.name; | ||
dotProperty = !left.computed; | ||
} else { | ||
@@ -108,14 +106,20 @@ property = scope.createIdentifier( 'property' ); | ||
if ( needsObjectVar ) { | ||
if ( needsObjectVar && needsPropertyVar ) { | ||
code.insert( left.start, `${object} = ` ); | ||
code.insert( left.object.end, `, ` ); | ||
code.overwrite( left.object.end, left.property.start, `, ${property} = ` ); | ||
code.overwrite( left.property.end, left.end, `, ${object}[${property}]` ); | ||
} | ||
if ( needsPropertyVar ) { | ||
code.insert( left.object.end, `${property} = ` ); | ||
code.move( left.property.start, left.property.end, left.object.end ); | ||
else if ( needsObjectVar ) { | ||
code.insert( left.start, `${object} = ` ); | ||
code.insert( left.object.end, `, ${object}` ); | ||
} | ||
code.remove( left.object.end, left.property.start ); | ||
code.overwrite( left.property.end, left.end, `, ${object}${ dotProperty ? `.${property}` : `[${property}]` }` ); | ||
else if ( needsPropertyVar ) { | ||
code.insert( left.start, `${property} = ` ); | ||
code.move( left.property.start, left.property.end, left.start ); | ||
code.insert( left.start, `, ` ); | ||
code.overwrite( left.object.end, left.property.start, `[${property}]` ); | ||
code.remove( left.property.end, left.end ); | ||
} | ||
@@ -125,3 +129,3 @@ code.insert( this.end, ` )` ); | ||
base = object + ( left.computed ? `[${property}]` : `.${property}` ); | ||
base = object + ( left.computed || needsPropertyVar ? `[${property}]` : `.${property}` ); | ||
} | ||
@@ -128,0 +132,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
1190319
10769