File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/packages/babel-plugin-react-compiler/src/Entrypoint Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments