We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a196459 commit 916ee46Copy full SHA for 916ee46
1 file changed
packages/babel-helper-wrap-function/src/index.ts
@@ -97,7 +97,12 @@ function plainFunction(
97
let functionId = null;
98
let node;
99
if (path.isArrowFunctionExpression()) {
100
- path = path.arrowFunctionToExpression({ noNewArrows });
+ if (process.env.BABEL_8_BREAKING) {
101
+ path = path.arrowFunctionToExpression({ noNewArrows });
102
+ } else {
103
+ // arrowFunctionToExpression returns undefined in @babel/traverse < 7.18.10
104
+ path = path.arrowFunctionToExpression({ noNewArrows }) ?? path;
105
+ }
106
node = path.node as t.FunctionDeclaration | t.FunctionExpression;
107
} else {
108
0 commit comments