Found while fixing #10482 (PR #10647), which installed Object.prototype.__proto__ as a real accessor descriptor.
Confirmed pre-existing — that PR neither caused nor changed this.
console.log((true).__proto__ === Boolean.prototype); // Node: true Perry: false (undefined)
console.log((1n).__proto__ === BigInt.prototype); // Node: true Perry: false (undefined)
Boolean and BigInt primitives return undefined for a dynamic .__proto__ read, where Node gives their
wrapper prototype.
Why Number/String work and these don't: PR #10647 fixed the recursive prototype-chain fallback in
primitive_builtin_prototype_property (crates/perry-runtime/src/object/field_get_set/accessors.rs) to preserve
the original primitive receiver via accessor_receiver_override_begin/_end, so (5).__proto__ now correctly
resolves to Number.prototype instead of the intermediate Object.prototype. Boolean/BigInt never reach
Object.prototype's accessor table at all — their dispatch takes a different route — so that fix does not apply
to them.
Start by finding where boolean and bigint property reads diverge from the number/string path; the fix is probably
routing them through the same fallback rather than adding a new mechanism.
Found while fixing #10482 (PR #10647), which installed
Object.prototype.__proto__as a real accessor descriptor.Confirmed pre-existing — that PR neither caused nor changed this.
BooleanandBigIntprimitives returnundefinedfor a dynamic.__proto__read, where Node gives theirwrapper prototype.
Why
Number/Stringwork and these don't: PR #10647 fixed the recursive prototype-chain fallback inprimitive_builtin_prototype_property(crates/perry-runtime/src/object/field_get_set/accessors.rs) to preservethe original primitive receiver via
accessor_receiver_override_begin/_end, so(5).__proto__now correctlyresolves to
Number.prototypeinstead of the intermediateObject.prototype.Boolean/BigIntnever reachObject.prototype's accessor table at all — their dispatch takes a different route — so that fix does not applyto them.
Start by finding where boolean and bigint property reads diverge from the number/string path; the fix is probably
routing them through the same fallback rather than adding a new mechanism.