Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed May 15, 2024
1 parent 0833955 commit 7846fca
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/babel-traverse/src/path/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,6 @@ const methods = {
// NodePath_conversion
toComputedKey: NodePath_conversion.toComputedKey,
ensureBlock: NodePath_conversion.ensureBlock,
...(!process.env.BABEL_8_BREAKING && !USE_ESM
? {
arrowFunctionToShadowed:
// workaround for rollup
// @ts-expect-error babel 7 only
NodePath_conversion[String("arrowFunctionToShadowed")],
}
: {}),
unwrapFunctionEnvironment: NodePath_conversion.unwrapFunctionEnvironment,
arrowFunctionToExpression: NodePath_conversion.arrowFunctionToExpression,

Expand Down Expand Up @@ -329,6 +321,14 @@ const methods = {

Object.assign(NodePath_Final.prototype, methods);

if (!process.env.BABEL_8_BREAKING && !USE_ESM) {
// @ts-expect-error babel 7 only
NodePath_Final.prototype.arrowFunctionToShadowed =
// workaround for rollup
// @ts-expect-error babel 7 only
NodePath_conversion[String("arrowFunctionToShadowed")];
}

if (!process.env.BABEL_8_BREAKING) {
// @ts-expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in
// different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.
Expand Down

0 comments on commit 7846fca

Please sign in to comment.