Fix Object.prototype reads before globalThis initialization - #11000
proggeramlug wants to merge 2 commits into
Conversation
|
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 configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe runtime now materializes the realm global before resolving inherited ChangesLazy Object Prototype Resolution
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Inherited Object.prototype members are now available from the first read or membership check without breaking prototype chains, shadowing, or null-prototype behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 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 |
|
Landed on main in merge train 258 (#11078, v0.5.1641), main Carried at head 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. |
Fixes #10880.
Summary
Ordinary inherited property reads and
inreturned a miss when this thread had not yet materializedglobalThis. The Object.prototype address cache intentionally returns zero in that state for its array write fast path, but inherited lookups need to initialize the intrinsic before resolving it.Materialize the realm global on that first inherited lookup and root the receiver and key across bootstrap, which can allocate and collect. Once the global exists, the existing cached path remains in use.
Add read-first and
in-first parity fixtures covering built-in members, custom chains, null prototypes, and own-property shadowing.Validation
object_prototypefixtures,test_parity_explicit_null_prototype, andtest_parity_object_ctor_inherited_proto_methodspass withPERRY_NO_AUTO_OPTIMIZE=1.cargo fmt --all --check, test registration, file size, andgit diff --checkpass.Summary by CodeRabbit
Object.prototypeproperties being unavailable during initial object access.typeof, theinoperator, and direct calls now correctly recognize inherited methods such astoString,hasOwnProperty, andvalueOf, including across prototype chains.