On 28 July 2011 10:35, David Bruant <david.bru...@labri.fr> wrote:
> Le 28/07/2011 06:21, Brendan Eich a écrit :
>>
>> == Handler access to proxies ==
>>
>> Proxy handler traps need to receive the proxy as a parameter: first, or
>> last?
>>
>> Last allows trap implementors to leave |proxy| off. It's also a compatible
>> extension to the proposal and its prototype implementations. Putting |proxy|
>> last may also steer implementors away from touching proxy, reducing the bugs
>> where you infinitely diverge.
>>
>> First is more normal-order (proxy, name) and some find it more
>> aesthetically pleasing.
>>
>> Another alternative: the proxy could be "passed" via a data property on
>> the handler.
>
> I think we discussed already the idea of "proxy" being passed as a data
> property to the handler and came to the conclusion that it may not be a good
> idea, because it breaks the stratification. If two proxies use the same
> handler as in [2], then, there is an ambiguity on what the value of this
> property should be.

The solution we discussed is to simply use prototypes. That is, share
handler methods by putting them on a (single) prototype object, and
have per-proxy instances that carry the individual proxy references
(or other per-proxy data, for that matter).

/Andreas
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to