On Mar 26, 2012, at 22:49 , Steven Levithan wrote:
> Norbert Lindenberg wrote:
>> The ugly world of web reality...
>>
>> Actually, in V8, Firefox, Safari, and IE, /[\u{10000}]/ seems to be the
>> same as /[\\u01{}]/ - it matches "\\u01{}u01". In Opera, it doesn't seem to
>> match anything, but doesn't throw the specified SyntaxError either.
>
> How did you test this. I get consistent results that agree with Erik in IE 9,
> Firefox 11, Chrome 17, and Safari 5.1:
>
> "\\u01{}".match(/[\u{10000}]/g); // ['u','0','1','{','}']
> /\u{2}/g.test("uu"); // true
Sorry, stupid mistake on my side. It is /[u01{}]/, as Erik said.
> Opera, as you said, returns null and false (tested v11.6 and v10.0).
>
>> Do we know of any applications actually relying on these bugs, seeing that
>> browsers don't agree on them?
>
> Minus Opera, browsers do agree on them. Admirably so. And they aren't
> bugs--they're intentional breaks from ES for backcompat with earlier
> implementations that were themselves designed for backcompat with older
> non-ES regex behavior. The RegExp Match Web Reality proposal at
> <http://wiki.ecmascript.org/doku.php?id=harmony:regexp_match_web_reality>
> says to add them to the spec, and Allen has said the web reality proposal
> should be the top RegExp priority for ES6.
Grumble. How about applying the web reality proposal only to old-style regex,
not when /u is set or implied?
Norbert
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss