Calling toString on function proxy throws TypeError exception

Allen Wirfs-Brock allen at
Thu Oct 22 18:59:55 UTC 2015

> On Oct 22, 2015, at 11:43 AM, Mark S. Miller <erights at> wrote:
> I know that's true in general. But we made a few exceptions, especially for functions and arrays. I thought F.p.toString was one, but maybe not. I just don't remember.

There are no such special cases that I’m aware of, and I don’t know how they would work. See the proxy [[Call]] internal method <> 

This is basically a coordination issue between the access of a method via a proxy [[Get]] and the invocation of the retrieved function via a [[Call]. Essentially, the creation of a membrane is required to make it work. As I’m sure you will recall, we explored using an invoke trap to help deal with this sort of situation but eventually abandoned that.  At the time we recognized that proxies that only used default handler would not be transparent in such situations and decide that it would be ok.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list