@babel/traverse
Advanced tools
Comparing version 7.4.5 to 7.5.0
@@ -47,3 +47,3 @@ "use strict"; | ||
return parentPath.insertBefore(nodes); | ||
} else if (this.isNodeType("Expression") && this.listKey !== "params" && this.listKey !== "arguments" || parentPath.isForStatement() && this.key === "init") { | ||
} else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") { | ||
if (this.node) nodes.push(this.node); | ||
@@ -200,3 +200,3 @@ return this.replaceExpressionWithStatements(nodes); | ||
return path.insertBefore(nodes); | ||
return path._containerInsertBefore(nodes); | ||
} | ||
@@ -203,0 +203,0 @@ |
@@ -209,2 +209,4 @@ "use strict"; | ||
const functionParent = this.getFunctionParent(); | ||
const isParentAsync = functionParent && functionParent.is("async"); | ||
const container = t().arrowFunctionExpression([], t().blockStatement(nodes)); | ||
@@ -239,2 +241,8 @@ this.replaceWith(t().callExpression(container, [])); | ||
callee.arrowFunctionToExpression(); | ||
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t().FUNCTION_TYPES)) { | ||
callee.set("async", true); | ||
this.replaceWith(t().awaitExpression(this.node)); | ||
} | ||
return callee.get("body.body"); | ||
@@ -241,0 +249,0 @@ } |
{ | ||
"name": "@babel/traverse", | ||
"version": "7.4.5", | ||
"version": "7.5.0", | ||
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", | ||
@@ -15,7 +15,7 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"@babel/code-frame": "^7.0.0", | ||
"@babel/generator": "^7.4.4", | ||
"@babel/generator": "^7.5.0", | ||
"@babel/helper-function-name": "^7.1.0", | ||
"@babel/helper-split-export-declaration": "^7.4.4", | ||
"@babel/parser": "^7.4.5", | ||
"@babel/types": "^7.4.4", | ||
"@babel/parser": "^7.5.0", | ||
"@babel/types": "^7.5.0", | ||
"debug": "^4.1.0", | ||
@@ -28,3 +28,3 @@ "globals": "^11.1.0", | ||
}, | ||
"gitHead": "33ab4f166117e2380de3955a0842985f578b01b8" | ||
"gitHead": "49da9a07c81156e997e60146eb001ea77b7044c4" | ||
} |
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
145087
4288
Updated@babel/generator@^7.5.0
Updated@babel/parser@^7.5.0
Updated@babel/types@^7.5.0