Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Object.prototype setter does not intercept a named store on an array (arr.zz = v creates an own key)

Open
#12,635 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
compilers

Research direction

Start with the four-line repro: define a setter on Object.prototype, then assign a non-index key on an array and check whether the setter runs. The payload names only the array named-property store path and the existing plain-object gap test, not specific files, so locate the store path first. Done means the setter fires with 7 and no own key is created, matching node's output, and the plain-object case still passes.

Written by the indexing model from the issue text.

Description

An accessor (setter) defined on Object.prototype does not intercept a named-property store on an array. The store creates an own property instead of calling the setter.

let hit = 0;
Object.defineProperty(Object.prototype, "zz", { set(v) { hit = v; }, configurable: true });
const arr = [1, 2, 3];
arr.zz = 7;
console.log(hit, Object.prototype.hasOwnProperty.call(arr, "zz"));
// node: 7 false
// perry (as reported by the step 3 lane): setter not called, own key created

[[Set]] on an ordinary object (arrays included, for non-index keys) must find the inherited accessor along the whole prototype chain (Array.prototype, then Object.prototype) and call its setter.

This was found while building the object-model step 3 whole-chain key-add interception, where the gap test covers the plain-object case only. The array case is already broken on main and isn't caused by step 3. The fix belongs in the array named-property store path: answer interception from every hop of the chain, the same way the ordinary key-add path does.

Dominant language
Rust
Stars
4.9k
Forks
166
Avg merge
1h 20m
Merged PRs (30d)
915

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PerryTS/perry

All issues in PerryTS/perry

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.