| This strawman was accepted and integrated into direct proxies |
In the current Proxy API, the defineProperty trap cannot faithfully emulate the reject behavior of [[DefineOwnProperty]]. As WebIDL may make use of this reject behavior, proxies need to emulate it in order to faithfully wrap the DOM.
Proposal: have the defineProperty trap return a boolean that indicates success. If false is returned, the built-in [[DefineOwnProperty]] method of a Proxy determines whether to fail silently or to throw an exception, depending on strictness. This change is compatible with the existing API, in which defineProperty‘s return value is ignored. It is also consistent with the signature of the set and delete traps.
[[DefineOwnProperty]] (P, Desc, Throw)
When the [[DefineOwnProperty]] internal method of a trapping proxy O is called with property name P, property descriptor Desc and Boolean flag Throw, the following steps are taken:
See proxies_semantics for the definition of TrapDefineOwnProperty.
defineProperty reject behavior.