summaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-transform-parameters/lib/params.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
commit06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch)
tree4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@babel/plugin-transform-parameters/lib/params.js
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
Diffstat (limited to 'node_modules/@babel/plugin-transform-parameters/lib/params.js')
-rw-r--r--node_modules/@babel/plugin-transform-parameters/lib/params.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/node_modules/@babel/plugin-transform-parameters/lib/params.js b/node_modules/@babel/plugin-transform-parameters/lib/params.js
index e5007013..a062b92d 100644
--- a/node_modules/@babel/plugin-transform-parameters/lib/params.js
+++ b/node_modules/@babel/plugin-transform-parameters/lib/params.js
@@ -111,14 +111,15 @@ function convertFunctionParams(path, ignoreFunctionLength, shouldTransformParam,
node.params = node.params.slice(0, firstOptionalIndex);
}
path.ensureBlock();
+ const path2 = path;
const {
async,
generator
} = node;
if (generator || state.needsOuterBinding || shadowedParams.size > 0) {
- body.push((0, _shadowUtils.buildScopeIIFE)(shadowedParams, path.node.body));
+ body.push((0, _shadowUtils.buildScopeIIFE)(shadowedParams, path2.node.body));
path.set("body", _core.types.blockStatement(body));
- const bodyPath = path.get("body.body");
+ const bodyPath = path2.get("body.body");
const arrowPath = bodyPath[bodyPath.length - 1].get("argument.callee");
arrowPath.arrowFunctionToExpression();
arrowPath.node.generator = generator;
@@ -126,16 +127,16 @@ function convertFunctionParams(path, ignoreFunctionLength, shouldTransformParam,
node.generator = false;
node.async = false;
if (async) {
- path.node.body = _core.template.statement.ast`{
+ path2.node.body = _core.template.statement.ast`{
try {
- ${path.node.body.body}
+ ${path2.node.body.body}
} catch (e) {
return Promise.reject(e);
}
}`;
}
} else {
- path.get("body").unshiftContainer("body", body);
+ path2.get("body").unshiftContainer("body", body);
}
return true;
}