On __proto__ as a magical data property
rossberg at google.com
Thu Jul 19 02:34:01 PDT 2012
On 18 July 2012 19:54, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> 2012/7/18 Andreas Rossberg <rossberg at google.com>
>> On 18 July 2012 12:35, David Bruant <bruant.d at gmail.com> wrote:
>>> Proxies are an even more fundamental violation of the JS object model.
>> Agreed (and one of the reservations I actually have about
>> adding proxies). However, proxies are proxies.
> I disagree ;-)
> I think as a byproduct of designing the Proxy API we now actually have a
> pretty well-defined *interface* to a JS object.
> The invariants called out in the "invariant enforcement" section on the
> wiki can be thought of as the minimal contract that comes with the
> interface. Proxies in some sense define the JS object model. Any
> implementation that satisfies the minimal contract does not violate the
> object model. Whether an implementation is a sensible implementation of the
> interface is a whole other matter.
> True, we cannot efficiently _enforce_ many behavioural invariants for
>> (user-defined) proxies. But that does not imply that we should feel free to
>> actively _break_ more invariants for (language-defined) non-proxies.
> I absolutely agree here.
Hm, I'm not quite sure I understand how you can disagree with the former
but agree with the latter. ;)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss