Compare commits

...

13 Commits

Author SHA1 Message Date
Sebastian McKenzie
d28583bea1 v4.7.16 2015-03-18 23:36:04 +11:00
Sebastian McKenzie
b166f35218 add typed arrays to native types list - #1043 2015-03-18 23:34:37 +11:00
Sebastian McKenzie
0914378bba add 4.7.16 changelog 2015-03-18 23:34:26 +11:00
Sebastian McKenzie
660d764390 remove loop check when aliasing breaks, continues etc - fixes #1051 2015-03-18 23:31:11 +11:00
Sebastian McKenzie
d919d7837c 4.7.15 2015-03-18 19:17:07 +11:00
Sebastian McKenzie
b49cf4e779 v4.7.15 2015-03-18 19:16:01 +11:00
Sebastian McKenzie
e30dd7042b fix constructor spreading of collections #1043 2015-03-18 19:14:23 +11:00
Sebastian McKenzie
16d8d928e8 4.7.14 2015-03-18 19:14:02 +11:00
Sebastian McKenzie
4966028397 v4.7.14 2015-03-18 19:11:21 +11:00
Sebastian McKenzie
82e04fffac add 4.7.14 changelog 2015-03-18 19:08:53 +11:00
Sebastian McKenzie
a46313903d deprecate abstract references and remaining playground features 2015-03-18 19:08:05 +11:00
Sebastian McKenzie
68340b1288 add Promise to the list of native types - fixes #1043 2015-03-18 19:06:34 +11:00
Sebastian McKenzie
7f9fe4af15 4.7.13 2015-03-17 12:12:51 +11:00
10 changed files with 64 additions and 7 deletions

View File

@@ -13,6 +13,24 @@ _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.16
* **Bug Fix**
* Fix constructor spreading of typed arrays.
* Fix break/continue/return aliasing of non-loops in block scoping transformer.
## 4.7.15
* **Bug Fix**
* Fix constructor spreading of collections.
## 4.7.14
* **Bug Fix**
* Fix constructor spreading of `Promise`.
* **Internal**
* Deprecate remaining playground transformers and abstract references.
## 4.7.13
* **Bug Fix**

View File

@@ -1,7 +1,7 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "4.7.13",
"version": "4.7.16",
"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.15",
"repository": "babel/babel",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"dependencies": {

View File

@@ -527,10 +527,6 @@ class BlockScoping {
}
if (has.hasBreakContinue) {
if (!loop) {
throw new Error("Aren't in a loop and we're trying to reassign breaks and continues, something is going wrong here.");
}
for (var key in has.map) {
cases.push(t.switchCase(t.literal(key), [has.map[key]]));
}

View File

@@ -24,6 +24,7 @@ var container = function (parent, call, ret, file) {
export function AssignmentExpression(node, parent, scope, file) {
var left = node.left;
if (!t.isVirtualPropertyExpression(left)) return;
console.error("Abstract references are deprecated and will be removed in 5.0.0");
var value = node.right;
var temp;
@@ -65,6 +66,7 @@ export function UnaryExpression(node, parent, scope, file) {
var arg = node.argument;
if (!t.isVirtualPropertyExpression(arg)) return;
if (node.operator !== "delete") return;
console.error("Abstract references are deprecated and will be removed in 5.0.0");
var call = util.template("abstract-expression-delete", {
PROPERTY: arg.property,
@@ -77,6 +79,7 @@ export function UnaryExpression(node, parent, scope, file) {
export function CallExpression(node, parent, scope) {
var callee = node.callee;
if (!t.isVirtualPropertyExpression(callee)) return;
console.error("Abstract references are deprecated and will be removed in 5.0.0");
var temp = scope.generateTempBasedOnNode(callee.object);
@@ -98,6 +101,7 @@ export function CallExpression(node, parent, scope) {
}
export function VirtualPropertyExpression(node) {
console.error("Abstract references are deprecated and will be removed in 5.0.0");
return util.template("abstract-expression-get", {
PROPERTY: node.property,
OBJECT: node.object
@@ -105,6 +109,7 @@ export function VirtualPropertyExpression(node) {
}
export function PrivateDeclaration(node) {
console.error("Abstract references are deprecated and will be removed in 5.0.0");
return t.variableDeclaration("const", node.declarations.map(function (id) {
return t.variableDeclarator(id, t.newExpression(t.identifier("WeakMap"), []));
}));

View File

@@ -16,6 +16,7 @@ build(exports, {
},
build(node) {
console.error("The mallet operator is deprecated and will be removed in 5.0.0");
return t.unaryExpression("!", node, true);
}
});

View File

@@ -11,6 +11,7 @@ build(exports, {
},
build(node, file) {
console.error("The memoization operator is deprecated and will be removed in 5.0.0");
return t.unaryExpression(
"!",
t.callExpression(

View File

@@ -25,7 +25,7 @@ function registerType(type: string, skipAliasCheck?: boolean) {
}
export var STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
export var NATIVE_TYPE_NAMES = ["Array", "Object", "Number", "Boolean", "Date", "Array", "String"];
export var NATIVE_TYPE_NAMES = ["Array", "Object", "Number", "Boolean", "Date", "Array", "String", "Promise", "Set", "Map", "WeakMap", "WeakSet", "Uint16Array", "ArrayBuffer", "DataView", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Uint32Array", "Int32Array", "Float32Array", "Int16Array", "Float64Array"];
export var FLATTENABLE_KEYS = ["body", "expressions"];
export var FOR_INIT_KEYS = ["left", "init"];
export var COMMENT_KEYS = ["leadingComments", "trailingComments"];

View File

@@ -0,0 +1,14 @@
foo.func1 = function() {
if (cond1) {
for (;;) {
if (cond2) {
function func2() {}
function func3() {}
func4(function() {
func2();
});
break;
}
}
}
};

View File

@@ -0,0 +1,22 @@
"use strict";
foo.func1 = function () {
if (cond1) {
for (;;) {
if (cond2) {
var _ret = (function () {
var func2 = function () {};
var func3 = function () {};
func4(function () {
func2();
});
return "break";
})();
if (_ret === "break") break;
}
}
}
};