diff options
Diffstat (limited to 'node_modules/@babel/plugin-transform-parameters/lib/params.js')
| -rw-r--r-- | node_modules/@babel/plugin-transform-parameters/lib/params.js | 11 |
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; } |
