Skip to content

path / impact: a file:line outside the file is refused with the file's length - #1734

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.7from
loop/ja-is1601
Sep 29, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.7from
loop/ja-is1601

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A file:line at line 0 or past the file's last line fell through to the module node and was answered as the file's top-level code. impact and path both resolve file:line in G._resolve, which now refuses such a line and gives the file's length: src/services/userService.js has 4 lines; line 99 is not in it.

  • Golden case tests/cases/javascript/fileline-line-outside-file: line 0, past-end, partial path, no trailing newline; controls: last line still answers as top-level code, a line in a function answers for it, an unindexed file is refused as before.
  • Checked: new case + impact / path: a file:line whose partial path matches two files answers for one of them, the one with the shorter function #1599 case 18/18; no_symlink.py 2/2; on a real Express app :0/:999 refused, last line unchanged, 2041 edges before and after (query-only). Full tests/run.py: the only failures (7) also fail on a clean 0.1.7 checkout, in cases this change does not touch.

Closes #1601

…s length (#1601)

Line 0, or a line past the last, spans no callable and fell through to the
module node, so it was answered as the file's top-level code as if that line
existed. Both verbs resolve file:line in G._resolve; it now refuses a line
below 1 and, reading the file on disk, a line past its end.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant