Re: May the defineProperty method of a proxy handler throw a TypeError?

2011/8/11 Tom Van Cutsem <tomvc.be@gmail.com>

> Noted. I'll write up a small strawman to change the signature of
> 'defineProperty' to return a boolean success value. This change should be
> fully compatible with the existing API, as the return value of the
> 'defineProperty' trap is currently ignored.
>

For completeness: it's here: <
http://wiki.ecmascript.org/doku.php?id=strawman:defineproperty_reject_behavior
>

One upwards-compatibility hazard I see is that all current Proxy code that
does not explicitly return a value from its |defineProperty| trap,
implicitly returns |undefined|, which is coerced to |false|. That is
probably not the behavior that was intended.

So, to future-proof if this strawman is accepted, I think it's best to let
existing |defineProperty| traps |return true;|.

Cheers,
Tom

Received on Monday, 15 August 2011 08:58:59 UTC