Skip to content

A Proxy used as an array prototype is treated as absent — its traps never run on indexed reads #9786

Description

@proggeramlug

array_custom_prototype in crates/perry-runtime/src/array/indexing_proto_chain.rs returns None for a Proxy prototype. Every caller reads None as "no custom prototype", so the array falls back to the default Array.prototype chain and the proxy's traps never run on indexed reads.

The in-source comment says a Proxy "keeps its existing dedicated handling in the in / property-get arms" — that handling does not cover the indexed read path.

                          node                      perry
inherited via proxy       "proxy-four"              undefined
get trap                  fired                     not fired
inherited hole            visible                   lost
index -1                  1                         -1

Repro

secret-tests/cases/adversarial/recent/26_array_deep_and_proxy_prototypes.ts

Relationship to other issues

Separable from the chain-depth defect, but the same file and likely the same fix window. #9221 was closed 2026-09-02 without covering this.

Done when

Case 26 matches node.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions