Skip to content

fix(runtime): resolve Boolean and BigInt inherited accessors - #10992

Closed
proggeramlug wants to merge 2 commits into
mainfrom
fix/10648-primitive-proto-accessor
Closed

proggeramlug wants to merge 2 commits into
mainfrom
fix/10648-primitive-proto-accessor

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10648.

Boolean and BigInt property reads returned undefined before reaching the inherited prototype-accessor path that Number uses. Route those tagged primitives through their builtin prototype lookup. The new path roots the BigInt receiver, property key, constructor, prototype, and previous accessor receiver across GC-capable lookups.

A focused runtime test is red on the untouched path and passes for true, false, 1n, and -1n with this change. A gap fixture checks the same reads against Node, with Number and String controls.

Verification:

  • CARGO_TARGET_DIR=/Users/amlug/projects/perry/agent-trees/fix-10645/target RUST_TEST_THREADS=1 cargo test -p perry-runtime --lib boolean_and_bigint_inherit_object_proto_getter -- --test-threads=1
  • node --experimental-strip-types test-files/test_gap_10648_primitive_dunder_proto.ts
  • rustfmt --check --edition 2021 on the changed Rust files and git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Fixed inherited __proto__ access for Boolean and BigInt primitive values.
    • Prototype lookups now preserve the original primitive receiver when resolving inherited accessors.
    • Added coverage for positive and negative BigInt values, both Boolean values, and existing Number and String behavior.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2eb5da28-2bf5-4f6a-9632-21aa8f1230da

📥 Commits

Reviewing files that changed from the base of the PR and between c1569e2 and 9ae474e.

📒 Files selected for processing (5)
  • changelog.d/10992-primitive-proto-accessor.md
  • crates/perry-runtime/src/object/field_get_set.rs
  • crates/perry-runtime/src/object/field_get_set/accessors.rs
  • crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs
  • test-files/test_gap_10648_primitive_dunder_proto.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The runtime now resolves inherited __proto__ accessors for Boolean and BigInt primitives. The lookup preserves the primitive receiver and returns the corresponding builtin prototype. Runtime and integration tests cover positive and negative values.

Changes

Boolean and BigInt prototype lookup

Layer / File(s) Summary
Prototype property helper
crates/perry-runtime/src/object/field_get_set/accessors.rs, crates/perry-runtime/src/object/field_get_set.rs, changelog.d/10992-primitive-proto-accessor.md
The runtime adds and re-exports a GC-safe helper for Boolean and BigInt prototype properties. The helper preserves the primitive receiver during accessor resolution and rebinds returned closures.
Property-read dispatch and validation
crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs, test-files/test_gap_10648_primitive_dunder_proto.ts
Boolean and BigInt keyed reads use the new helper before object lookup. Tests cover __proto__ reads for Boolean and positive and negative BigInt values, with Number and String controls.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9ae47

Boolean and BigInt primitive prototype reads are covered by the new dispatch and regression cases, with no remaining concrete merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: resolving inherited accessors for Boolean and BigInt primitives.
Description check ✅ Passed The description explains the bug, implementation, linked issue, focused tests, Node comparison, and formatting checks. It does not reproduce the template headings or checklist, but it includes the req…
Linked Issues check ✅ Passed Issue #10648 requires Boolean and BigInt primitive property reads to reach inherited prototype accessors and preserve the primitive receiver. The PR adds primitive_tagged_prototype_property, roots v…
Out of Scope Changes check ✅ Passed The changed runtime files implement the issue behavior. The focused gap test verifies the required Boolean and BigInt cases. The changelog entry documents the same behavior. No unrelated change is sho…
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main in merge train 258 (#11078, v0.5.1641), main e27f0a068a.

Carried at head 9ae474ed91. CI on the train head was fully green — 22 jobs, zero failures, the first train since the public-baseline artifact was regenerated, so no known-red line to read past.

This train was bisect-verified: after an earlier 35-PR assembly hit five gap regressions, the lowering-touching PRs were split into probes, and this set (#11070) came back with all six gap shards clean while the other half reproduced all five.

Trains rebase-merge, so commits get new SHAs and GitHub cannot mark this merged. Closed as landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant