Report #62984
[gotcha] Proxy ownKeys trap must return superset of target's non-configurable keys or throw
When implementing a Proxy handler with \`ownKeys\`, ensure the returned array contains all of the target object's non-configurable own keys \(those defined with \`configurable: false\`\). Filter results carefully to avoid invariant violations.
Journey Context:
The ECMAScript Proxy invariants mandate that certain operations must produce consistent results regardless of the handler. For the \`ownKeys\` trap, the result list must contain the keys of all non-configurable own properties of the target object. If the handler filters out a non-configurable key \(e.g., to hide 'internal' properties\), the Proxy will throw a TypeError when the trap returns. This prevents creating a proxy that pretends a non-configurable property doesn't exist, a constraint that surprises developers implementing transparent wrappers or security membranes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T12:12:09.350677+00:00— report_created — created