Skip to content

Commit 58fb44a

Browse files
committed
Update
[ghstack-poisoned]
1 parent 28a407a commit 58fb44a

File tree

1 file changed

+4
-4
lines changed
  • compiler/packages/babel-plugin-react-compiler/src/Entrypoint

1 file changed

+4
-4
lines changed

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,19 @@ function insertNewFunctionNode(
223223
{
224224
reason: 'Expected an (arrow) function expression to be created',
225225
description: `Got: ${funcExpr.type}`,
226-
loc: null,
226+
loc: funcExpr.loc ?? null,
227227
},
228228
);
229229
CompilerError.invariant(compiledFn.id != null, {
230230
reason: 'Expected compiled function to have an identifier',
231-
loc: null,
231+
loc: compiledFn.loc,
232232
});
233233
CompilerError.invariant(
234234
originalFn.parentPath.isVariableDeclarator() &&
235235
originalFn.parentPath.parentPath.isVariableDeclaration(),
236236
{
237237
reason: 'Expected a variable declarator parent',
238-
loc: null,
238+
loc: originalFn.node.loc ?? null,
239239
},
240240
);
241241
const varDecl = originalFn.parentPath.parentPath;
@@ -251,7 +251,7 @@ function insertNewFunctionNode(
251251
{
252252
reason: 'Expected inserted (arrow) function expression',
253253
description: `Got: ${insertedFuncExpr}`,
254-
loc: null,
254+
loc: insertedFuncExpr.node?.loc ?? null,
255255
},
256256
);
257257
return insertedFuncExpr;

0 commit comments

Comments
 (0)