babel-core
Advanced tools
Comparing version 4.4.2 to 4.4.3
@@ -16,2 +16,10 @@ # Changelog | ||
## 4.4.3 | ||
* **Bug Fix** | ||
* Fix `for...of` iterator break returns being duplicated. | ||
* Only call `return` on the iterator if it exists. | ||
* **Internal** | ||
* Rename `selfContained` transformer to `runtime`. | ||
## 4.4.2 | ||
@@ -18,0 +26,0 @@ |
@@ -179,3 +179,3 @@ "use strict"; | ||
if (opts.externalHelpers) { | ||
this.set("runtimeIdentifier", t.identifier("babelHelpers")); | ||
this.set("helpersNamespace", t.identifier("babelHelpers")); | ||
} | ||
@@ -337,3 +337,3 @@ | ||
var runtime = this.get("runtimeIdentifier"); | ||
var runtime = this.get("helpersNamespace"); | ||
if (runtime) { | ||
@@ -340,0 +340,0 @@ name = t.identifier(t.toIdentifier(name)); |
@@ -1,1 +0,3 @@ | ||
{} | ||
{ | ||
"selfContained": "runtime" | ||
} |
@@ -56,4 +56,5 @@ "use strict"; | ||
); | ||
if (state.wrapReturn) ret = state.wrapReturn(ret); | ||
ret = state.wrapReturn(ret); | ||
this.skip(); | ||
return [ret, node]; | ||
@@ -103,3 +104,9 @@ } | ||
wrapReturn: function (node) { | ||
return t.ifStatement(t.unaryExpression("!", isArrayKey, true), node); | ||
return t.ifStatement( | ||
t.logicalExpression( | ||
"&&", | ||
t.unaryExpression("!", isArrayKey, true), | ||
t.memberExpression(iteratorKey, t.identifier("return") | ||
) | ||
), node); | ||
}, | ||
@@ -150,2 +157,5 @@ label: t.isLabeledStatement(parent) && parent.label.name | ||
iteratorKey: iteratorKey, | ||
wrapReturn: function (node) { | ||
return t.ifStatement(t.memberExpression(iteratorKey, t.identifier("return")), node); | ||
}, | ||
label: t.isLabeledStatement(parent) && parent.label.name | ||
@@ -152,0 +162,0 @@ }); |
@@ -82,3 +82,3 @@ module.exports = { | ||
// needs to be before `es6.modules` due to dynamic imports | ||
selfContained: require("./other/self-contained"), | ||
runtime: require("./other/runtime"), | ||
@@ -85,0 +85,0 @@ // needs to be before `_blockHoist` due to function hoisting etc |
{ | ||
"name": "babel-core", | ||
"description": "Turn ES6 code into readable vanilla ES5 with source maps", | ||
"version": "4.4.2", | ||
"version": "4.4.3", | ||
"author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
@@ -6,0 +6,0 @@ "homepage": "https://babeljs.io/", |
Sorry, the diff of this file is too big to display
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
1590498
13475