diff --git a/packages/babel-traverse/src/path/introspection.ts b/packages/babel-traverse/src/path/introspection.ts index a3aa04131bfb..dc1a82333b37 100644 --- a/packages/babel-traverse/src/path/introspection.ts +++ b/packages/babel-traverse/src/path/introspection.ts @@ -401,7 +401,7 @@ export function _guessExecutionStatusRelativeToDifferentFunctions( // a. not called at all (part of an export) // b. called directly const bindingName = targetIsGenericFunctionExpression - ? (target.parent as t.VariableDeclarator).id.name + ? ((target.parent as t.VariableDeclarator).id as t.Identifier).name : (target.node as t.FunctionDeclaration).id.name; const binding = target.scope.getBinding(bindingName);