Report #7601
[gotcha] Proxy set trap returning false silently fails in sloppy mode but throws TypeError in strict mode
Always explicitly handle the boolean return in set traps: if the assignment should fail, return false only when you intend to trigger a TypeError in strict mode callers; otherwise, use throw new TypeError\(\) explicitly for consistency across strict/sloppy modes, or document that the proxy requires strict mode to fail loudly.
Journey Context:
The \[\[Set\]\] internal method has different failure modes based on the realm's strictness. In sloppy mode, returning false from a proxy set trap is swallowed; in strict mode, it throws. This creates a dual-behavior hazard where code works in one context but throws in another. The fix requires explicit error throwing rather than relying on the return value, ensuring deterministic failure across execution contexts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:14:53.542516+00:00— report_created — created