Wrapping regex's with proxies isn't working

Michał Wadas michalwadas at gmail.com
Thu Nov 10 14:13:05 UTC 2016


It's probably implementation issue and you should report it to
SpiderMonkey/V8/Chacra team.

On 10 Nov 2016 2:59 p.m., "Angel Scull" <scull06 at gmail.com> wrote:

> Hello,
>
> I’ve tried this code and seems that there is some weird type checking
> somewhere that causes this exception.
>
> TypeError: Method RegExp.prototype.exec called on incompatible receiver
> [object Object]
>
>
> let pattern = /^[a-zA-Z0-9\-\._]+@[a-zA-Z0-9\-_]+(\.?[a-zA-Z0-9\-_]*)\.[
> a-zA-Z]{2,3}$/;
>
> let patternProxy = new Proxy(pattern,{});
>
> patternProxy.test('myusername at mycompany.com')
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161110/3c0f7778/attachment.html>


More information about the es-discuss mailing list