RegExp.$1 spec
Francis Cheng
fcheng at adobe.com
Fri Apr 6 10:29:21 PDT 2007
Just a random thought: What if we made it permissible in standard mode,
but illegal in strict mode? That would give us backward compatibility
and reinforce the idea that it's a scripting-friendly practice that is
not a good idea for larger programs.
Francis
-----Original Message-----
From: es4-discuss-bounces at mozilla.org
[mailto:es4-discuss-bounces at mozilla.org] On Behalf Of Lars T Hansen
Sent: Friday, April 06, 2007 3:11 AM
To: Brendan Eich
Cc: es4-discuss at mozilla.org; Erik Arvidsson
Subject: Re: RegExp.$1 spec
On 4/5/07, Brendan Eich <brendan at mozilla.org> wrote:
> Ugh, I'd forgotten about this. If it's implemented in all of IE,
> Mozilla, Opera, and Safari, then it might be best to codify it in
> ES4. OTOH we would then want to deprecate it. If we can let it alone
> as a de-facto standard, not make it normative in the de-jure spec,
> and thereby more effectively deprecate it, that would be best IMHO.
Storing global state on shared global objects is script-friendly but
bad practice for larger programs IMO (and is likely to interact poorly
with future developments for multiprocessing). It interacts poorly
with libraries too, since it allows library implementation (does it
use regexes or String.prototype.indexOf?) can become visible. The
order and timing of event handler firings (probably not 100%
compatible between user agents) matters for program correctness. Etc.
The cat's out of the bag, but making the problem worse by condoning
the practice does not seem right.
Does anyone know how widespread the use of this mechanism is?
--lars
>
> /be
>
> On Apr 5, 2007, at 1:30 PM, Erik Arvidsson wrote:
>
> > I cannot find any spec for how RegExp.$1 etc should work. It is not
> > part of the 3rd edition but all user agents seems to implement this.
> > Is there a spec for this somewhere? Should this be added to edition
4?
> >
> > --
> > erik
> > _______________________________________________
> > Es4-discuss mailing list
> > Es4-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es4-discuss
>
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>
_______________________________________________
Es4-discuss mailing list
Es4-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss
More information about the Es4-discuss
mailing list