Skip to content

Commit d87c1ee

Browse files
committed
fix(caller): use nullish coalescing for endLine to avoid treating 0 as unbounded
Replace `|| Infinity` with `?? Infinity` in findCaller so that a definition with endLine=0 (a valid single-line node at the start of a file) is not incorrectly treated as having unbounded span.
1 parent 1875c7f commit d87c1ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/domain/graph/builder/call-resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function findCaller(
9393

9494
for (const def of definitions) {
9595
if (def.line <= call.line) {
96-
const end = def.endLine || Infinity;
96+
const end = def.endLine ?? Infinity;
9797
if (call.line <= end) {
9898
const span = end === Infinity ? Infinity : end - def.line;
9999
if (CALLABLE_KINDS.has(def.kind)) {

0 commit comments

Comments
 (0)