> 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,
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
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,
> 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)
>
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
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
6 matches
Mail list logo