Closed
Bug 228336
Opened 22 years ago
Closed 22 years ago
bug with braces in JavaScript regular expressions
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.5R5
People
(Reporter: pschwartau, Assigned: igor)
Details
(Whiteboard: [ Rhino version of bug 228087 against SpiderMonkey ])
Attachments
(1 file)
This is the Rhino version of bug 228087 against SpiderMonkey.
The following regexp patterns are causing SyntaxErrors:
js> re = /{1.*}/g;
js: uncaught JavaScript exception: SyntaxError: Invalid quantifier {
js> re = /{1[.!}]*}/g;
js: uncaught JavaScript exception: SyntaxError: Invalid quantifier {
This is correct per ECMA-262 Ed. 3, which prohibits the use of unescaped
braces in regexp patterns unless they form part of a quantifier.
However, as part of the SpiderMonkey RegExp rewrite (bug 85721), it was
decided to follow Perl and IE, and allow unescaped braces even if they
are not part of a quantifier.
See bug 188206 comment 12; also bug 223273 comment 29 and following.
It looks like the RegExp parser is mistakenly identifying the above
use of braces as quantifiers (hence the SyntaxErrors), instead of
the non-quantifier, literal use of unescaped braces that we permit.
The testcase for this bug is
mozilla/js/tests/ecma_3/RegExp/regress-228087.js
It is currently failing in both the SpiderMonkey and Rhino shells -
| Reporter | ||
Updated•22 years ago
|
Whiteboard: [ Rhino version of bug 228087 against SpiderMonkey ]
| Assignee | ||
Comment 2•22 years ago
|
||
This is a Rhino version of Brandan's patch from attachment 138844 [details] [diff] [review], bug 228087
plus code to fix overflow problem reported in bug 230216.
| Assignee | ||
Comment 3•22 years ago
|
||
I committed the fix
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•