Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-core

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-core - npm Package Compare versions

Comparing version 4.4.2 to 4.4.3

lib/babel/transformation/transformers/other/runtime.js

8

CHANGELOG.md

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

4

lib/babel/transformation/file.js

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc