babel-helper-remap-async-to-generator
Advanced tools
Comparing version 6.0.16 to 6.1.2
@@ -53,5 +53,12 @@ /* @flow */ | ||
if (path.isArrowFunctionExpression()) { | ||
path.arrowFunctionToShadowed(); | ||
} | ||
node.async = false; | ||
node.generator = true; | ||
var asyncFnId = node.id; | ||
node.id = null; | ||
var built = t.callExpression(callId, [node]); | ||
@@ -68,18 +75,17 @@ var container = buildWrapper({ | ||
if (path.isFunctionDeclaration()) { | ||
var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(node.id.name), t.callExpression(container, []))]); | ||
var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(asyncFnId.name), t.callExpression(container, []))]); | ||
declar._blockHoist = true; | ||
_babelHelperFunctionName2["default"]({ | ||
node: retFunction, | ||
parent: declar.declarations[0], | ||
scope: path.scope | ||
}); | ||
retFunction.id = asyncFnId; | ||
path.replaceWith(declar); | ||
} else { | ||
_babelHelperFunctionName2["default"]({ | ||
node: retFunction, | ||
parent: path.parent, | ||
scope: path.scope | ||
}); | ||
if (asyncFnId && asyncFnId.name) { | ||
retFunction.id = asyncFnId; | ||
} else { | ||
_babelHelperFunctionName2["default"]({ | ||
node: retFunction, | ||
parent: path.parent, | ||
scope: path.scope | ||
}); | ||
} | ||
@@ -86,0 +92,0 @@ if (retFunction.id || node.params.length) { |
{ | ||
"name": "babel-helper-remap-async-to-generator", | ||
"version": "6.0.16", | ||
"version": "6.1.2", | ||
"description": "", | ||
@@ -11,6 +11,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator", | ||
"babel-template": "^6.0.16", | ||
"babel-types": "^6.0.15", | ||
"babel-traverse": "^6.0.16", | ||
"babel-types": "^6.1.2", | ||
"babel-traverse": "^6.1.2", | ||
"babel-helper-function-name": "^6.0.15" | ||
} | ||
} |
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
3623
81
Updatedbabel-traverse@^6.1.2
Updatedbabel-types@^6.1.2