Calling toString on function proxy throws TypeError exception
Mark Miller
erights at gmail.com
Tue Oct 27 17:44:27 UTC 2015
Non-membraned proxies are irreparably non-transparent. This case is not
worth worrying about.
On Tue, Oct 27, 2015 at 1:05 PM, Claude Pache <claude.pache at gmail.com>
wrote:
>
> > Le 27 oct. 2015 à 15:52, Mark S. Miller <erights at google.com> a écrit :
> >
> > Notice that whatever we decide on the issue, functionProxy.toString()
> will work regardless, since you'd be getting the toString method itself
> through the membrane. functionProxy.toString will be a function proxy for
> the target.toString method.
>
> ... at the condition that the proxy handler explicitly traps the getting
> of the toString method. It is certainly the case for impermeable membranes,
> but not for all proxies. Concretely, `new Proxy(function() {},
> {}).toString()` does throw in ES2015.
>
> —Claude
>
>
> > The invocation on the toString proxy with functionProxy as this will be
> translated by the membrane back into an invocation of target.toString with
> target as this.
> >
> > The issue we're debating is only relevant on an edge case -- when
> explicitly invoking F.p.toString.call(functionProxy).
> >
> >
> > --
> > Cheers,
> > --MarkM
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
--
Text by me above is hereby placed in the public domain
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151027/a7c0bc09/attachment.html>
More information about the es-discuss
mailing list