@babel/plugin-transform-parameters
Advanced tools
Comparing version 7.20.1 to 7.20.3
@@ -117,3 +117,7 @@ "use strict"; | ||
path.ensureBlock(); | ||
if (state.needsOuterBinding || shadowedParams.size > 0 || node.generator) { | ||
const { | ||
async, | ||
generator | ||
} = node; | ||
if (generator || state.needsOuterBinding || shadowedParams.size > 0) { | ||
body.push((0, _shadowUtils.buildScopeIIFE)(shadowedParams, path.node.body)); | ||
@@ -126,6 +130,15 @@ path.set("body", _core.types.blockStatement(body)); | ||
arrowPath.arrowFunctionToExpression(); | ||
arrowPath.node.generator = path.node.generator; | ||
arrowPath.node.async = path.node.async; | ||
path.node.generator = false; | ||
arrowPath.node.generator = generator; | ||
arrowPath.node.async = async; | ||
node.generator = false; | ||
node.async = false; | ||
if (async) { | ||
path.node.body = _core.template.statement.ast`{ | ||
try { | ||
${path.node.body.body} | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
}`; | ||
} | ||
} else { | ||
@@ -132,0 +145,0 @@ path.get("body").unshiftContainer("body", body); |
{ | ||
"name": "@babel/plugin-transform-parameters", | ||
"version": "7.20.1", | ||
"version": "7.20.3", | ||
"description": "Compile ES2015 default and rest parameters to ES5", | ||
@@ -17,3 +17,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.19.0" | ||
"@babel/helper-plugin-utils": "^7.20.2" | ||
}, | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.19.6", | ||
"@babel/core": "^7.20.2", | ||
"@babel/helper-plugin-test-runner": "^7.18.6" | ||
@@ -30,0 +30,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
63964
533