2013/9/18 David Bruant <[email protected]> > ... I just realized that in your examples, the private state is stored > in a weakmap which requires target identity. If I recall, the original > problem wasn't so much with weakmaps, but rather with Date instances which > is slightly different. > If solving weakmap lookups via |this| binding is worth solving, maybe we > need to start considering solving weakmap lookups via the receiver of get > and set traps, etc. As well as weakmap lookups via 1st, 2nd, 3rd, etc. > argument. >
We already have a solution to this: membranes do exactly the right wrapping/unwrapping for all arguments (including |this|, return values, and thrown exceptions). > What does make the 0th argument (this binding) so special? > The fact that many OO programmers don't consider |this| to be an argument and depend on it being of a particular "type". The methods on many of JS's built-ins are a good example. But this is getting philosophical. The fact remains that we should make it easy for proxies to translate |proxy.method(...args)| into |target.method(...args)| calls.
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

