Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
poteto committed Jul 24, 2024
1 parent 28a407a commit 58fb44a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@ function insertNewFunctionNode(
{
reason: 'Expected an (arrow) function expression to be created',
description: `Got: ${funcExpr.type}`,
loc: null,
loc: funcExpr.loc ?? null,
},
);
CompilerError.invariant(compiledFn.id != null, {
reason: 'Expected compiled function to have an identifier',
loc: null,
loc: compiledFn.loc,
});
CompilerError.invariant(
originalFn.parentPath.isVariableDeclarator() &&
originalFn.parentPath.parentPath.isVariableDeclaration(),
{
reason: 'Expected a variable declarator parent',
loc: null,
loc: originalFn.node.loc ?? null,
},
);
const varDecl = originalFn.parentPath.parentPath;
Expand All @@ -251,7 +251,7 @@ function insertNewFunctionNode(
{
reason: 'Expected inserted (arrow) function expression',
description: `Got: ${insertedFuncExpr}`,
loc: null,
loc: insertedFuncExpr.node?.loc ?? null,
},
);
return insertedFuncExpr;
Expand Down

0 comments on commit 58fb44a

Please sign in to comment.