Allow unescaped braces in regexp patterns, if not part of a quantifier?

RESOLVED FIXED in 1.5R5

Status

RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: pschwartau, Assigned: igor)

Tracking

other
1.5R5
x86
Windows NT

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
The following testcase fails in Rhino:

      mozilla/js/tests/ecma_3/RegExp/regress-188206.js


The failures all occur between sections 14 and 27 of the test.
Here are comments from the testcase on these sections:


116 /*
117  * Misusing the {DecmalDigits} quantifier - according to ECMA,
118  * but not according to Perl.
119  *
120  * ECMA-262 Edition 3 prohibits the use of unescaped braces in
121  * regexp patterns, unless they form part of a quantifier.
122  *
123  * Hovever, Perl does not prohibit this. If not used as part
124  * of a quantifer, Perl treats braces literally.
125  *
126  * We decided to follow Perl on this for backward compatibility.
127  * See http://bugzilla.mozilla.org/show_bug.cgi?id=190685.
128  *
129  * Therefore NONE of the following ECMA violations should generate
130  * a SyntaxError. Note we use checkThis() instead of testThis().
131  */


Currently Rhino is correctly throwing an error according to ECMA.
But do we want to stay in synch with SpiderMonkey on this?
(Assignee)

Comment 1

15 years ago
I will look at it
Assignee: nboyd → igor
(Assignee)

Comment 2

15 years ago
Created attachment 136898 [details] [diff] [review]
Fix: adjusted version of Roger Lawrence patch from attachment 128343 [details] [diff] [review]

Roger made a fix for Rhino in July and added it as
http://bugzilla.mozilla.org/show_bug.cgi?id=190685#c13 .

It fails to apply due to my changes to make compiled form of regular expression
scope-independent that caused some code movements that was too complex for the
patch utility. This is the adjusted version.
(Assignee)

Comment 3

15 years ago
CC Roger
(Assignee)

Comment 4

15 years ago
I committed the fix
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

15 years ago
Trageting as resolved against 1.5R5
Target Milestone: --- → 1.5R5
You need to log in before you can comment on or make changes to this bug.