Re: Disabling nonstandard RegExp functionalities for proper subclasses of RegExp

2016-04-27 Thread Claude Pache
> Le 27 avr. 2016 à 15:46, Andrea Giammarchi a > écrit : > > What I am saying is that `class MyRE extends RegExp {}` should *not* inherit > any magic property from global `RegExp` but *also* should *not* pollute the > global `RegExp` when used. > > Right now,

Re: Disabling nonstandard RegExp functionalities for proper subclasses of RegExp

2016-04-27 Thread Mark S. Miller
Sorry, none of these examples are persuasive. Such non-local causality is a nightmare on many grounds. If we did want to provide equivalent functionality somehow, we should find a non-stupid way to package it. I like Claude's proposal as stated: Annex B normative *optional*, configurable and

Re: Disabling nonstandard RegExp functionalities for proper subclasses of RegExp

2016-04-27 Thread Andrea Giammarchi
What I am saying is that `class MyRE extends RegExp {}` should *not* inherit any magic property from global `RegExp` but *also* should *not* pollute the global `RegExp` when used. Right now, the code I've tested on Chrome, suffers pollution either ways: `MyRE.$1` is `RegExp.$1` and vice versa,

Re: Disabling nonstandard RegExp functionalities for proper subclasses of RegExp

2016-04-27 Thread Claude Pache
> Le 27 avr. 2016 à 06:50, Andrea Giammarchi a > écrit : > > My 2 cents. > > I always had the feeling people complaining about `RegExp.$1` and friends > never really used them. > > For instance, your example: > > ```js > /(a)/.exec('a') > Object.keys(bar) >

Re: Disabling nonstandard RegExp functionalities for proper subclasses of RegExp

2016-04-26 Thread Andrea Giammarchi
My 2 cents. I always had the feeling people complaining about `RegExp.$1` and friends never really used them. For instance, your example: ```js /(a)/.exec('a') Object.keys(bar) RegExp.$1 ``` might have side effects but it's also made up and, I believe, not a real-world concern. If you use

Disabling nonstandard RegExp functionalities for proper subclasses of RegExp

2016-04-26 Thread Claude Pache
Hi, About the bad old nonstandard RegExp functionalities: * `RegExp.prototype.compile()` — currently in Annex B; * `RegExp.$1`, `RegExp.leftContext`, etc. — currently unspecced. Although we could probably not get rid of them for plain regexps, I think it is a good idea to disable them for