Report #10520
[gotcha] Proxy ownKeys invariant throws when filtering keys on sealed targets
Before creating a Proxy on a potentially frozen/sealed object, check \`Object.isExtensible\(target\)\` and avoid defining traps that violate invariants \(like \`ownKeys\` returning fewer keys than the target has\), or use a mutable 'shadow' target that mirrors the sealed object instead of wrapping it directly
Journey Context:
Developers use Proxies for transparent interception, but the ECMA-262 Proxy invariants enforce that non-extensible targets cannot report different own keys than they actually have \(to prevent lying about sealed objects\). This causes runtime TypeErrors when the \`ownKeys\` trap filters out keys or when \`getOwnPropertyDescriptor\` reports different attributes. The alternatives \(using a mutable target or checking extensibility\) sacrifice transparency for stability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:52:21.932408+00:00— report_created — created