RegExps that don't modify global state?

Andrea Giammarchi andrea.giammarchi at gmail.com
Sun Sep 21 11:48:44 PDT 2014


a code that does not instantly check results through `RegExp` access is
basically dead anyway since unreliable or potentially broken later on but a
flag to opt out sill make this a no-problem, right?

That code is legacy that should work as "impossible to mark as dead"
anyway, not sure changing this would help those cases.

On Sun, Sep 21, 2014 at 7:11 AM, John Lenz <concavelenz at gmail.com> wrote:

> I wanted to mention the global state of regexs prevent the elimination of
> otherwise dead code by optimizers.  Which is unfortunate. I personally have
> fixed a number of bugs where a regex overwrote the global state.  It is a
> refactoring hazard.
> On Sep 17, 2014 8:58 PM, "Viktor Mukhachev" <addslashes at yandex.ru> wrote:
>
>>
>> `lastIndex` also prevents usage of one instance in parallel...
>> I know the javascript do not support parallel execution, but the code is
>> not so beatiful...
>>
>> the idea to "deprecate" lastIndex was proposed 4 years ago:
>>
>> see
>> http://blog.stevenlevithan.com/archives/fixing-javascript-regexp
>>
>> http://esdiscuss.org/topic/proposal-for-exact-matching-and-matching-at-a-position-in-regexp
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> 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/20140921/2e7a1be6/attachment.html>


More information about the es-discuss mailing list