Socket
Socket
Sign inDemoInstall

regenerator-transform

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regenerator-transform - npm Package Compare versions

Comparing version 0.9.6 to 0.9.7

16

lib/visit.js

@@ -73,4 +73,11 @@ "use strict";

var node = childPath.node;
if (node && node._blockHoist != null) {
if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) {
// Babylon represents directives like "use strict" as elements
// of a bodyBlockPath.node.directives array, but they could just
// as easily be represented (by other parsers) as traditional
// string-literal-valued expression statements, so we need to
// handle that here. (#248)
outerBody.push(node);
} else if (node && node._blockHoist != null) {
outerBody.push(node);
} else {

@@ -127,2 +134,9 @@ innerBody.push(node);

var oldDirectives = bodyBlockPath.node.directives;
if (oldDirectives) {
// Babylon represents directives like "use strict" as elements of
// a bodyBlockPath.node.directives array. (#248)
node.body.directives = oldDirectives;
}
var wasGeneratorFunction = node.generator;

@@ -129,0 +143,0 @@ if (wasGeneratorFunction) {

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Explode async and generator functions into a state machine.",
"version": "0.9.6",
"version": "0.9.7",
"main": "lib/index.js",

@@ -8,0 +8,0 @@ "keywords": [

@@ -59,4 +59,12 @@ /**

let node = childPath.node;
if (node && node._blockHoist != null) {
if (t.isExpressionStatement(node) &&
t.isStringLiteral(node.expression)) {
// Babylon represents directives like "use strict" as elements
// of a bodyBlockPath.node.directives array, but they could just
// as easily be represented (by other parsers) as traditional
// string-literal-valued expression statements, so we need to
// handle that here. (#248)
outerBody.push(node);
} else if (node && node._blockHoist != null) {
outerBody.push(node);
} else {

@@ -121,2 +129,9 @@ innerBody.push(node);

const oldDirectives = bodyBlockPath.node.directives;
if (oldDirectives) {
// Babylon represents directives like "use strict" as elements of
// a bodyBlockPath.node.directives array. (#248)
node.body.directives = oldDirectives;
}
let wasGeneratorFunction = node.generator;

@@ -123,0 +138,0 @@ if (wasGeneratorFunction) {

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