fix(array): route collection reads before array validation - #8061
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesMap and Set indexed-read fix
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The change routes Map/Set indexed reads before strict array validation while preserving rejection of non-array inputs through the array-only path; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
Summary
clean_arr_ptr's strict array-only validationFixes #8060.
Causal evidence
Exact base:
ef6e111a4fb85dcc9fd81f69c30bf57a0bf40a61.#8041 made
clean_arr_ptrreject every tracked non-array, butjs_array_get_f64reached its Map/Set branches only after that rejection. Six pre-existing tests failed individually withNaNinstead of collection values.js_array_lengthwas the positive control: it already consulted the managed tag and authoritative registry before cleaning, and returned the correct sizes for the same receivers.Local validation
Using isolated worktree and target:
cargo check -p perry-runtime --libcargo fmt --all --checkgit diff --checkOne full default-parallel runtime suite after the fix reported 2,313 passed, 1 failed, 4 ignored. The sole failure was
promise::keyed_table::tests::settling_many_keys_is_not_quadratic, the independently diagnosed wall-clock assertion replaced by #8059; all six #8060 tests and the shadow-root witness passed.Summary by CodeRabbit
Bug Fixes
MapandSetvalues so they no longer incorrectly returnNaN.undefined.Tests
MapandSetindexing behavior, pointer validation, registry-backed reads, and collection size reporting.Documentation