Merge branch 'master' into experimental

# Conflicts:
#	src/babel/transformation/transformers/internal/strict.js
This commit is contained in:
Sebastian McKenzie
2015-03-17 12:14:32 +11:00
6 changed files with 33 additions and 10 deletions

View File

@@ -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**

View File

@@ -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",

View File

@@ -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": {

View File

@@ -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) {

View File

@@ -0,0 +1,2 @@
var z = {};
var { x: { y } = {} } = z;

View 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;