Wrapping regex's with proxies isn't working

Isiah Meadows isiahmeadows at gmail.com
Thu Nov 10 21:10:18 UTC 2016


The complaint here is that it's impermeable when it would be preferred not
to be. I personally have never yet needed a proxy where nothing else would
suffice, so I pretty much have no stake in this discussion.

On Thu, Nov 10, 2016, 11:34 Claude Pache <claude.pache at gmail.com> wrote:

> Le 10 nov. 2016 à 15:50, Isiah Meadows <isiahmeadows at gmail.com> a écrit :
>
> This could be resolved by checking the underlying non-proxy object and
> using that one's internal slots instead, in each language-level method that
> checks that.
>
>
> Such semantics could make impossible to write impermeable proxies for some
> objects, e.g.
>
> ```js
> let s = new Set
> let sProxy = new Proxy(s, { /* .... */ })
> Set.prototype.add.call(sProxy, "foo") // will add "foo" to `s`, even if
> you were careful enough to intercept `sProxy.add("foo")`
> Set.prototype.has.call(sProxy, "bar") // will reveal whether "bar" is in
> `s`
> ```
>
> —Claude
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161110/b056ee13/attachment.html>


More information about the es-discuss mailing list