fix: preserve fractional keys in dynamic array reads - #10229
proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe dynamic numeric-index fallback now preserves fractional, negative, non-finite, and oversized keys as property lookups. New runtime and regression tests cover regular, lazy, materialized, and JSON arrays. ChangesFractional array index fix
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The fractional array-key fix has no confirmed merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 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 |
Summary
JSON.parse('[{"id":1},{"id":2},{"id":3}]')[0.5]returned the first element because the dynamic runtime fallback truncated its numeric key toi32. It now returnsundefined, or resolves an own/inherited"0.5"property when one exists.Changes
i32range before narrowing it.i32::MAX.Related issue
Fixes #10190
Test plan
RUST_TEST_THREADS=1 cargo test -p perry-runtime --lib dynamic_numeric_key_testspasses (3 tests).RUST_TEST_THREADS=1 cargo test -p perry-runtime --lib indexpasses (168 tests).cargo build -p perry -p perry-runtime-static -p perry-stdlib-staticin the default dev profile; verified all three artifact timestamps follow the runtime edit.test_gap_10190_fractional_array_index.tsandtest_gap_array_index_range_proof.tswith those archives and--no-auto-optimize; both outputs match Node 26.5.1 byte-for-byte.git diff --checkpass.scripts/pre-tag-check.sh --quickpasses all checks except the existing public benchmark artifact freshness failure; benchmark fingerprint inputs are unchanged from base6000a00dfe.Checklist
Cargo.lock,CLAUDE.md, orCHANGELOG.md.Summary by CodeRabbit
CI follow-up
CI is red. The logs show the runtime custom-thread-stack test failure, generated API-doc drift, benchmark freshness failure, existing warnings, and the separate TLS-checker failure. The independent branches #10229, #10230, and #10232 report the same eight gap failures:
iterator_prototype_next_patch(Node oracle exit 1),2899_2779_2777_static_helpers,disposablestack_2875,gc_http2_pending_event_callback_rooting(port 443 permission denial),2159_defineproperty_class_prototype(Perry exit 13),json_lazy_defineproperty_index(descriptor-read assertion),perfhooks_3088_3008_3010_3011, andv8_2_3680plus(Perry exit 1). The HTTP/2 failure also appears in all seven GC-stress arms. This concurrence supports a shared base/environment cause; it is not an exact-main A/B rerun. The PR does not have green CI.