@babel/helper-remap-async-to-generator
Advanced tools
Comparing version 7.0.0-beta.46 to 7.0.0-beta.47
@@ -9,3 +9,3 @@ "use strict"; | ||
function _helperWrapFunction() { | ||
var data = _interopRequireDefault(require("@babel/helper-wrap-function")); | ||
const data = _interopRequireDefault(require("@babel/helper-wrap-function")); | ||
@@ -20,3 +20,3 @@ _helperWrapFunction = function _helperWrapFunction() { | ||
function _helperAnnotateAsPure() { | ||
var data = _interopRequireDefault(require("@babel/helper-annotate-as-pure")); | ||
const data = _interopRequireDefault(require("@babel/helper-annotate-as-pure")); | ||
@@ -31,3 +31,3 @@ _helperAnnotateAsPure = function _helperAnnotateAsPure() { | ||
function t() { | ||
var data = _interopRequireWildcard(require("@babel/types")); | ||
const data = _interopRequireWildcard(require("@babel/types")); | ||
@@ -45,10 +45,12 @@ t = function t() { | ||
var awaitVisitor = { | ||
Function: function Function(path) { | ||
const awaitVisitor = { | ||
Function(path) { | ||
path.skip(); | ||
}, | ||
AwaitExpression: function AwaitExpression(path, _ref) { | ||
var wrapAwait = _ref.wrapAwait; | ||
var argument = path.get("argument"); | ||
AwaitExpression(path, { | ||
wrapAwait | ||
}) { | ||
const argument = path.get("argument"); | ||
if (path.parentPath.isYieldExpression()) { | ||
@@ -61,2 +63,3 @@ path.replaceWith(argument.node); | ||
} | ||
}; | ||
@@ -68,7 +71,7 @@ | ||
}); | ||
var isIIFE = checkIsIIFE(path); | ||
const isIIFE = checkIsIIFE(path); | ||
path.node.async = false; | ||
path.node.generator = true; | ||
(0, _helperWrapFunction().default)(path, t().cloneNode(helpers.wrapAsync)); | ||
var isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty(); | ||
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty(); | ||
@@ -86,3 +89,3 @@ if (!isProperty && !isIIFE && path.isExpression()) { | ||
var parentPath = path.parentPath; | ||
const parentPath = path.parentPath; | ||
@@ -92,3 +95,3 @@ if (parentPath.isMemberExpression() && t().isIdentifier(parentPath.node.property, { | ||
})) { | ||
var bindCall = parentPath.parentPath; | ||
const bindCall = parentPath.parentPath; | ||
return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && t().isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({ | ||
@@ -95,0 +98,0 @@ callee: bindCall.node |
{ | ||
"name": "@babel/helper-remap-async-to-generator", | ||
"version": "7.0.0-beta.46", | ||
"version": "7.0.0-beta.47", | ||
"description": "Helper function to remap async functions to generators", | ||
@@ -9,8 +9,8 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator", | ||
"dependencies": { | ||
"@babel/helper-annotate-as-pure": "7.0.0-beta.46", | ||
"@babel/helper-wrap-function": "7.0.0-beta.46", | ||
"@babel/template": "7.0.0-beta.46", | ||
"@babel/traverse": "7.0.0-beta.46", | ||
"@babel/types": "7.0.0-beta.46" | ||
"@babel/helper-annotate-as-pure": "7.0.0-beta.47", | ||
"@babel/helper-wrap-function": "7.0.0-beta.47", | ||
"@babel/template": "7.0.0-beta.47", | ||
"@babel/traverse": "7.0.0-beta.47", | ||
"@babel/types": "7.0.0-beta.47" | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
73
0
3392
+ Added@babel/code-frame@7.0.0-beta.47(transitive)
+ Added@babel/generator@7.0.0-beta.47(transitive)
+ Added@babel/helper-annotate-as-pure@7.0.0-beta.47(transitive)
+ Added@babel/helper-function-name@7.0.0-beta.47(transitive)
+ Added@babel/helper-get-function-arity@7.0.0-beta.47(transitive)
+ Added@babel/helper-split-export-declaration@7.0.0-beta.47(transitive)
+ Added@babel/helper-wrap-function@7.0.0-beta.47(transitive)
+ Added@babel/highlight@7.0.0-beta.47(transitive)
+ Added@babel/template@7.0.0-beta.47(transitive)
+ Added@babel/traverse@7.0.0-beta.47(transitive)
+ Added@babel/types@7.0.0-beta.47(transitive)
+ Addedbabylon@7.0.0-beta.47(transitive)
- Removed@babel/code-frame@7.0.0-beta.46(transitive)
- Removed@babel/generator@7.0.0-beta.46(transitive)
- Removed@babel/helper-annotate-as-pure@7.0.0-beta.46(transitive)
- Removed@babel/helper-function-name@7.0.0-beta.46(transitive)
- Removed@babel/helper-get-function-arity@7.0.0-beta.46(transitive)
- Removed@babel/helper-split-export-declaration@7.0.0-beta.46(transitive)
- Removed@babel/helper-wrap-function@7.0.0-beta.46(transitive)
- Removed@babel/highlight@7.0.0-beta.46(transitive)
- Removed@babel/template@7.0.0-beta.46(transitive)
- Removed@babel/traverse@7.0.0-beta.46(transitive)
- Removed@babel/types@7.0.0-beta.46(transitive)
- Removedbabylon@7.0.0-beta.46(transitive)
Updated@babel/types@7.0.0-beta.47