On Mar 26, 2012, at 2:13 PM, Erik Corry wrote:
> This is too nasty.   The regexp constructor should not have to look up
> the stack to see what behaviour is expected of it.

I think you misunderstood me - I think we're saying the same thing. :-)

If we do imply the u flag for regexp literals in modules, and if we do make 
these regexps unable to match unpaired surrogates, then we may need to provide 
a method for programmers to create non-unicode aware regexps from within 
modules.

I was simply stating that since the regexp constructor isn't going to look up 
the stack to determine where it is being called from (we agree here), then a 
call to RegExp("\uD800") will create a non-unicode matching regexp, and as such 
a mechanism to create non-unicode regular expressions from within modules 
already exists.  (If this weren't available we might have wanted to provide a 
symmetric flag to /u for regexp literals in modules to opt-out of unicode 
matching, but given that calling the RexExp constructor is a convenient 
alternative I don't think this is necessary or desirable).

cheers,
G.


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to