Repository navigation
bun:test: print a long run of array holes as one line in matcher diffs #43963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
robobun
wants to merge
1
commit into
main
Choose a base branch
from
robobun/d5b2e304/test-diff-sparse-array-holes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 nit (optional): maintainers get two more hand-written exports in the monolithic bindings.cpp, which the repo's review rules ask new bindings to avoid. Bun__JSArray__nextPresentVectorIndex and Bun__JSArray__copySortedSparseIndices are new extern "C" entry points added at src/jsc/bindings/bindings.cpp:7191-7230 next to the pre-existing Bun__JSArray__nextPresentIndex. Fix: move the three JSArray storage helpers (nextPresentVectorIndex, sparseMapOf and the three exports) into their own file under src/jsc/bindings/ so the shared vector scan stays in one place without growing the god file; the Rust extern declarations in src/jsc/JSValue.rs need no change. [also at: src/jsc/bindings/bindings.cpp:7230 - nit: maintainers get two more exported bindings added to the monolithic bindings.cpp, which the repo's review rules ask new bindings to avoid.]
Why this was flagged
The diff adds two new extern "C" functions to src/jsc/bindings/bindings.cpp at lines 7191-7230 (Bun__JSArray__nextPresentVectorIndex and Bun__JSArray__copySortedSparseIndices) plus two static helpers. The repository review rules state 'no bindings in monolithic bindings.cpp' as an architecture rule. The PR description acknowledges this and says a move is mechanical. There is no runtime consequence; the base branch only had the one sibling export there. A fix is a file move; the Rust side links by symbol name so nothing else changes.
Verification: nit; acknowledged in diff: the PR description says "REVIEW.md asks for no new bindings there. If a new file is wanted, the move is mechanical" — the acknowledgement is accurate (the move is only a file move; the Rust side links by symbol name in src/jsc/JSValue.rs:2604 and :2620). Mechanism verified:
git diff 29d9638..HEAD -- src/jsc/bindings/bindings.cppadds two newextern "C"exports…There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two new exports share one vector scan with
Bun__JSArray__nextPresentIndex, which #33158 added to this file. A move has to take that function too, or the scan exists twice. The open #42247 edits that function, and the open #42238 adds its collector next to it, so a move now conflicts with both.I left the placement as a question in the description. If a maintainer wants the new file, I make the move.