RegExps that don't modify global state?

Andrea Giammarchi andrea.giammarchi at gmail.com
Wed Sep 17 08:59:47 PDT 2014


FWIW that 's' flag would work for me, but about not being specd, those
properties are described already here:
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-getreplacesubstitution

and these are a long time de-facto standard. "somebody" wrote already about
them a while ago:
http://msdn.microsoft.com/en-us/library/ie/9dthzd08(v=vs.94).aspx

Regards


On Wed, Sep 17, 2014 at 4:39 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>
wrote:

>
> On Sep 16, 2014, at 11:22 PM, Brendan Eich wrote:
>
> > Jussi Kalliokoski wrote:
> >> Unicode flag disabling features to enable parallelism is another
> footnote for WTFJS.
> >
> > A bit overdone, but I agree on this point.
> >
> > A separate flag per regexp, and/or a way to opt-out of RegExp.$foo
> altogether, seem better.
>
> Speaking strictly from a standards perspective, it seems that we are
> getting a bit ahead of ourselves.
>
> The $ properties  of RegExp and the behavior of of setting them to reflect
> the most recent exec is not part of any edition of ECMA-262.  It seems like
> they should be in Annex B, but apparently nobody has ever proposed that
> and/or offered a specification for them.
>
> Getting them into Annex B sounds like the first step.
>
> Since it is Annex B that defines them, Annex B could then also define a
> flag to eliminate them them.  But then a program that asserted that it
> didn't want to use that Annex B feature would be dependent upon the
> presence of Annex B support.
>
> Annex B contains many changes to RegExp from the base standard.  Perhaps a
> better way to approach this is to have a standard  (not Annex B) regexp
> flag (perhaps 's', for "standard" or "strict") that means that this regexp
> should be strictly applied using only the ES standard semantics without any
> Annex B or other extensions.
>
> Allen
> _______________________________________________
> 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/20140917/e3896f1b/attachment.html>


More information about the es-discuss mailing list