Merge branch 'master' into experimental
# Conflicts: # src/babel/transformation/transformers/internal/strict.js
This commit is contained in:
@@ -13,6 +13,14 @@ _Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
|
||||
|
||||
## 4.7.13
|
||||
|
||||
* **Bug Fix**
|
||||
* Handle comments on use strict directives.
|
||||
* Fix assignment patterns with a left side pattern.
|
||||
* **Polish**
|
||||
* Special case `this` when doing expression memoisation.
|
||||
|
||||
## 4.7.12
|
||||
|
||||
* **Bug Fix**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "4.7.12",
|
||||
"version": "4.7.13",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-runtime",
|
||||
"description": "babel selfContained runtime",
|
||||
"version": "4.7.12",
|
||||
"version": "4.7.13",
|
||||
"repository": "babel/babel",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"dependencies": {
|
||||
|
||||
@@ -290,14 +290,21 @@ class DestructuringTransformer {
|
||||
|
||||
//
|
||||
|
||||
this.nodes.push(this.buildVariableAssignment(
|
||||
pattern.left,
|
||||
t.conditionalExpression(
|
||||
t.binaryExpression("===", tempValueRef, t.identifier("undefined")),
|
||||
pattern.right,
|
||||
tempValueRef
|
||||
)
|
||||
));
|
||||
var tempConditional = t.conditionalExpression(
|
||||
t.binaryExpression("===", tempValueRef, t.identifier("undefined")),
|
||||
pattern.right,
|
||||
tempValueRef
|
||||
);
|
||||
|
||||
var left = pattern.left;
|
||||
if (t.isPattern(left)) {
|
||||
this.nodes.push(t.expressionStatement(
|
||||
t.assignmentExpression("=", tempValueRef, tempConditional)
|
||||
));
|
||||
this.push(left, tempValueRef);
|
||||
} else {
|
||||
this.nodes.push(this.buildVariableAssignment(left, tempConditional));
|
||||
}
|
||||
}
|
||||
|
||||
pushObjectSpread(pattern, objRef, spreadProp, spreadPropIndex) {
|
||||
|
||||
2
test/fixtures/transformation/es6-destructuring/assignment-expression-pattern/actual.js
vendored
Normal file
2
test/fixtures/transformation/es6-destructuring/assignment-expression-pattern/actual.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
var z = {};
|
||||
var { x: { y } = {} } = z;
|
||||
6
test/fixtures/transformation/es6-destructuring/assignment-expression-pattern/expected.js
vendored
Normal file
6
test/fixtures/transformation/es6-destructuring/assignment-expression-pattern/expected.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
var z = {};
|
||||
var _z$x = z.x;
|
||||
_z$x = _z$x === undefined ? {} : _z$x;
|
||||
var y = _z$x.y;
|
||||
Reference in New Issue
Block a user