Notification proxies (Was: possible excessive proxy invariants for Object.keys/etc??)
bruant.d at gmail.com
Wed Nov 28 14:08:45 PST 2012
Le 26/11/2012 21:39, David Bruant a écrit :
> Le 26/11/2012 20:59, Tom Van Cutsem a écrit :
>> 2012/11/26 David Bruant <bruant.d at gmail.com <mailto:bruant.d at gmail.com>>
>> We could define a symbolic value (like StopIteration for
>> iterators) that would mean "forward to target". By essence of
>> what forwarding to the target means, there would be no need to
>> perform the least invariant check. We can call it ForwardToTarget :-)
>> I think we've previously entertained a similar proposal when a
>> handler was encountering the .public property of a private property
>> it didn't know, and then wanted to signal to the proxy "I don't know
>> this private name, please forward".
> True. I had the feeling the idea wasn't entirely knew, but I couldn't
> recall what was the inspiration for it.
>> I recall one issue was that you'd really want a unique token per trap
>> invocation, which costs.
> I don't understand why a unique token per trap invocation would be
I still don't understand this point.
I've gone spelunking. I've found:
* the wiki page  (reflecting July meeting) which mentions that
returning undefined would express "I don't know the private name, please
* Confirmed on July 31st .
* Introduction of the idea of putting the verification of known names
somewhere else than for each trap return . Some discussion in between
about this idea. Introduction of the idea of adding a third argument 
after which I think stops all discussions about returning something in
traps to prove knowledge of a private name or forwarding when not knowing.
I don't remember the point about a token per trap invocation and I
haven't been able to find it (but I haven't read everything).
In any case, for "throw ForwardToTarget", I don't see why it would be
necessary. It seems it would work unambiguously with meta-handlers, with
target-as-a-proxy or with manipulate-any-other-proxy-inside-a-trap
(which target-as-a-proxy is an instance of).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss