Closed Bug 225926 Opened 21 years ago Closed 21 years ago

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

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows NT
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pschwartau, Assigned: igor)

Details

Attachments

(1 file)

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?
I will look at it
Assignee: nboyd → igor
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.
CC Roger
I committed the fix
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
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.

Attachment

General

Creator:
Created:
Updated:
Size: