Calling toString on function proxy throws TypeError exception

Allen Wirfs-Brock allen at
Mon Oct 26 19:20:54 UTC 2015

> On Oct 26, 2015, at 11:20 AM, Mark Miller <erights at> wrote:
> I like the idea a function proxy is more encapsulating of its implementation than a function is.
> I also like the idea of treating a function proxy as a builtin callable, rather than a function written in JS, and return something like "function () { [function proxy] }" as Tom suggested or "function () { [native code] }" as Claude suggested. We need progress on the draft spec for F.p.toString reform, including the standardized pattern for the function sources that are not supposed to parse, e.g., "function () { [...stuff...] }”.

I guess I still don’t understand the use case for applying there built-in F.p.toString to any callable.  If you are explicitly defining a callable proxy you may want to define a `toString` method for it that does something that makes sense for the specific kind of callable you are creating. But when you expect to do:

   evalableString =;

with the expectation that the result you are going to get will be useful for anything?


More information about the es-discuss mailing list