Closed
Bug 330796
Opened 18 years ago
Closed 12 years ago
"Invalid quantifier" error message shows wrong part of regexp
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: jruderman, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: testcase)
Attachments
(1 file)
206 bytes,
text/html
|
Details |
Steps to reproduce: 1. new RegExp("(a**cd)") Result: The error message includes the entire rest of the regular expression. "SyntaxError: invalid quantifier *cd)" Expected: Either it should work (with a** equivalent to (a*)*), or it should have a sensible error message (such as "invalid quantifier **" or "you can't put a quantifier right after a quantifier"). P.S. Safari accepts regular expressions like this, but they don't do what I'd expect. For example, it accepts /a**/, but I can't find a string for which /a**/.test(...) is true in Safari.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
See also bug 332472, another bug involving this error message.
Comment 3•18 years ago
|
||
Safari uses PCRE, which does not follow ECMA-262 Edition 3 fully. This is not related to bug 332472, which concerns dependent string input to new RegExp. Here, the string input can be independent, but the diagnostic will show the wrong suffix of that string. /be
Comment 4•13 years ago
|
||
These days, the testcase just says "invalid quantifier". Chrome says "Invalid regular expression: /(a**cd)/: Nothing to repeat".
Flags: in-testsuite?
OS: Mac OS X → All
Hardware: PowerPC → All
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•