[Proxies] Refactoring prototype climbing in the spec
Tom Van Cutsem
tomvc.be at gmail.com
Thu Nov 10 01:36:45 PST 2011
2011/11/9 Allen Wirfs-Brock <allen at wirfs-brock.com>
> [[Get]] seems to do nothing but redispatch to [[GetP]] so its definition
> could be replaced with the body of [[GetP]].
>
> [[Puit] does a redispatch to [[SetP]] followed by a "mode" based
> conditional throw depending upon the result of the [[SetP]]. I din't think
> the the throwing behavior needs (or even should) be over-ride able by a
> proxy (or even by an alternative internal implementation). I would factor
> the conditional throw code out of [[Put]] and make it the responsibility
> of the caller. In practice, this just means that I would define a new
> Abstraction Operation that is used in place of direct calls to [[Put]].
> The abstraction operation wold essentially have the definition you provide
> for [[Put]] except that it would call [[Put]] instead of [[SetP]] and the
> definition of [[Put]] would be replaced with the body of [[SetP]]
>
Agreed. So if I understood all of that correctly, we would have:
- Abstract [[GetProperty]] and [[SetProperty]] operations (the methods I
called [[GetP]] and [[SetP]])
- Object.getProperty and Object.setProperty built-ins that call
[[GetProperty]] and [[SetProperty]]
- [[Get]] and [[Set]] methods on Objects that call [[GetProperty]] and
[[SetProperty]]
- [[Get]] and [[Set]] methods on Proxies that trigger "get" and "set" traps
- An abstract operation [[Put]](O, P, V, Throw) that calls
O.[[Set]](O,P,V) and performs the "strict mode" reject behavior.
Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111110/8d878382/attachment-0001.html>
More information about the es-discuss
mailing list