2011/12/21 Herby Vojčík <[email protected]>
> What about the second possibility that was there (calling a specific call
> to signal "please forward")? In my original proposal it would break
> execution of the trap immediately, but it is probably just an exception in
> disguise - it can be so that such a call sets a flag "please forward" and
> the trap function is allowed to run along until it does a return and after
> that return, the proxy machinery does the forwarding. No need to complicate
> return values by tuples, then, just set the flag and return.
>
I don't think that helps either:
1) You still need to allocate a separate flag per call to deal with
reentrancy.
2) The ability to set a flag that will override a trap's return value, and
still allowing the trap to return a value can be terribly confusing:
get: function() {
... f(); ...
return v;
}
Now, deep down in the call stack of f(), the flag is set. The value v
returned from the get trap will be ignored. The non-locality of mutating a
flag can lead to difficult to debug programs.
Cheers,
Tom
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss