May the defineProperty method of a proxy handler throw a TypeError?
Tom Van Cutsem
tomvc.be at gmail.com
Mon Aug 15 01:58:32 PDT 2011
2011/8/11 Tom Van Cutsem <tomvc.be at 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: <
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;|.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss