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

David Flanagan dflanagan at
Mon Aug 8 14:20:48 PDT 2011

On 6/20/11 1:13 AM, Tom Van Cutsem wrote 
> But my question remains: how important is it for a Proxy to be able to 
> faithfully emulate the reject behavior of assignment in non-strict 
> code? If it is important then we should probably have the 
> defineProperty trap return a success value, just like delete or set.

No one seems to have answered the question. Maybe that means it is not 
so important. The one data point I'd like to add is that WebIDL (§4.7.3 
and elsewhere) is written to use the ECMA-262 Reject operation. If Proxy 
can't correctly emulate reject behavior in non-strict code, then I can't 
correctly implement the DOM in JavaScript.

On 6/17/11, Cameron McCormack wrote 
> It seems like proxies should allow throwing/ignoring based on strict
> modeness of the caller.  I’ll leave the requirements to Reject in there
> for now.
Since WebIDL is in last-call status, this is probably a good time to 
decide whether the proxy proposal should change to allow faithful 
emulation of Reject, or whether WebIDL should change to throw a 
TypeError instead of using Reject...


More information about the es-discuss mailing list