On defining non-standard exotic objects

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Jan 9 14:18:13 PST 2013


On Jan 9, 2013, at 1:56 PM, David Bruant wrote:

> Le 09/01/2013 20:30, Allen Wirfs-Brock a écrit :
>> ...
> 
>> I don't see any need for an intermediate proxy representation or for attempting to limit non-proxy based extension mechanisms.  However, if Proxy is not sufficiently powerful to support everything that needs to be done in the real world (and in particular by browsers) then we probably should be looking at how to fill those deficiencies.
> Agreed.
> 

I guess I should have also said, that Proxy should be viewed as the last resort solution and should seldom be needed. Method dispatch based extension hooks like the @@create, @@hasInstance, and @@ToPrimitive hooks in the current ES6 draft and the hooks described in the "Object Model Reformation" [ 1] strawman operate at a higher meta level and are probably generally preferable to proxy based solutions.  It is impossible for them to violate the object invariants. If we still have self-hosting deficiencies we probably should first look for that style of solution before extending Proxy.

Allen

[1]  http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130109/614dc005/attachment.html>


More information about the es-discuss mailing list