2015-10-22 23:09 GMT+02:00 Allen Wirfs-Brock <[email protected]>:
>
>
> Why would it be reasonable to do this for `toString`, but not also `call`,
> `apply`, and `bind`? And ultimately this problem exists for all built-in
> methods that have have internal state dependencies. I just don’t see why we
> care so much specifically about `toString`
>
Calling Function.prototype.{call,apply,bind} on a function proxy should
obviously work (not throw a TypeError), as a function proxy has
well-defined behavior in such cases. For toString(), the two obvious
choices are to forward (show the function body of the target function), or
to generate a custom toString() representation like other exotic objects do
(e.g. "function () { [function proxy] }", or perhaps even show the
toString() representation of the apply trap).
Cheers,
Tom
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss