Skip to content

Object [[Get]] does not inherit user-assigned Object.prototype properties through the prototype chain #4656

@proggeramlug

Description

@proggeramlug

Surfaced while landing #4595 (JSON.parse reviver). General object-model gap, not reviver-specific.

A plain object's [[Get]] does not walk to Object.prototype for properties assigned there at runtime. Minimal repro:

(Object.prototype as any).foo = 99;
const o: any = { foo: 1 };
delete o.foo;
console.log(o.foo); // Node: 99 (inherited)   Perry: 1 / undefined

Node prints 99; Perry returns the stale own value (or undefined after delete) — the inherited Object.prototype.foo is never consulted.

Failing test262 (built-ins/JSON/parse/), which rely on re-reading an inherited value after the reviver deletes the own property:

  • reviver-object-get-prop-from-prototype
  • reviver-array-get-prop-from-prototype

The reviver walk now correctly does a real [[Get]] re-read per #4595; it's [[Get]]'s prototype-chain traversal for assigned Object.prototype members that's missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions