Wrapping regex's with proxies isn't working

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Nov 11 19:21:08 UTC 2016


> On Nov 10, 2016, at 1:10 PM, Isiah Meadows <isiahmeadows at gmail.com> wrote:
> 
> 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. 

This issue is well known to the proxy champions and has been repeatedly discussed on es-discuss and in TC39 meeting notes and presentations. Anybody who wants to talk about this, should first come up to speed with all that background.

The fundamental issue is that the default hander semantics is not transparent to methods that implicitly or explicitly depend upon the identity of the target object. Such identify dependencies include access to specification (or implementation) defined internal slots or any other mechanisms such as WeakMap lookup using a method's `this` value as the key.   

There are various schemes by which proxy handlers can explicitly deal with these issue. For example, by defining a handler that implements a membrane around  the target object.

Allen



More information about the es-discuss mailing list