Closed
Bug 309840
Opened 19 years ago
Closed 19 years ago
Regular expression /[/]/ gives "unterminated character class" error
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: mrbkap)
References
()
Details
(Keywords: verified1.8)
Attachments
(1 file)
1.86 KB,
patch
|
brendan
:
review+
shaver
:
superreview+
asa
:
approval1.8b5+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b5) Gecko/20050923
Firefox/1.4
Firefox gives an "unterminated character class" error on the regular expression
/[/]/. Safari and Opera 8.5 accept it.
I noticed this because a regular expression containing [/] appears in
http://msdn.microsoft.com/workshop/code/browdata.js, which was mentioned in
bug 309695 comment 9.
Comment 1•19 years ago
|
||
->all/all.
This is technically invalid. <http://bclary.com/2004/11/07/ecma-262#a-7.8.5>. I
have some raw data on top sites I can mine for how common this is in the wild.
OS: MacOS X → All
Hardware: Macintosh → All
Version: 1.8 Branch → Trunk
Comment 2•19 years ago
|
||
This is entirely contrary to ECMA-262 Edition 3, and to its regexp progenitor,
Perl. However, mrbkap expressed sympathy, however fleeting under my withering
counterattack ;-). He wins this no-prize.
I'm quite interested in bclary's top site spidering results.
/be
Assignee: general → mrbkap
Comment 3•19 years ago
|
||
I've been running scans of the top 69 sites 1 level deep (usually ~100 pages per
site) and haven't seen an instance of this error. This doesn't imply that the
error is rare. It has been a reoccuring issue over the years, especially on MS
sites. I could run a 2 level scan if you think it would be worth it, but it
would take a few days.
Assignee | ||
Comment 4•19 years ago
|
||
I think if we want this, we want it for Firefox 1.5.
Flags: blocking1.8b5?
Reporter | ||
Comment 5•19 years ago
|
||
I searched for bugs with comments containing "unterminated character class" and
found these:
Open tech evang bugs: bug 235508, bug 224988 (Microsoft), bug 212822
Bugs with discussion: bug 89586, bug 173067, bug 212822
Comment 6•19 years ago
|
||
Need a fix this week if this is going to make it.
Flags: blocking1.8b5? → blocking1.8b5+
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Whiteboard: DUPEME
Assignee | ||
Comment 7•19 years ago
|
||
Attachment #197590 -
Flags: superreview?(brendan)
Attachment #197590 -
Flags: review?(shaver)
Comment 8•19 years ago
|
||
Comment on attachment 197590 [details] [diff] [review]
Allow / in char classes
sr=shaver
Attachment #197590 -
Flags: superreview?(brendan) → superreview+
Assignee | ||
Updated•19 years ago
|
Attachment #197590 -
Flags: review?(shaver) → review?(brendan)
Comment 9•19 years ago
|
||
we're not going to hold the release for this but if it comes to us with full
reviews and it's low risk, we can talk.
Flags: blocking1.8b5+ → blocking1.8b5-
Comment 10•19 years ago
|
||
Comment on attachment 197590 [details] [diff] [review]
Allow / in char classes
Yeah, this is safe. The only way to close a character class is with an
unescaped ], and you can't nest character classes, so a boolean suffices.
/be
Attachment #197590 -
Flags: review?(brendan)
Attachment #197590 -
Flags: review+
Attachment #197590 -
Flags: approval1.8b5?
Assignee | ||
Comment 11•19 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Attachment #197590 -
Flags: approval1.8b5? → approval1.8b5+
Comment 12•19 years ago
|
||
Comment on attachment 197590 [details] [diff] [review]
Allow / in char classes
This fixes a highly dup'ed IE compatibility bug. It's an extension to ECMA
syntax that's allowed by Section 16. I'm approving it so that we can get it
into 1.8b5 / Firefox 1.5b2.
/be
Comment 13•19 years ago
|
||
Don't forget to set fixed1.8 when this lands on the branch tonight.
/be
Flags: blocking1.8b5- → blocking1.8b5+
Reporter | ||
Comment 15•19 years ago
|
||
*** Bug 235508 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 16•19 years ago
|
||
*** Bug 212822 has been marked as a duplicate of this bug. ***
Comment 17•19 years ago
|
||
*** Bug 224988 has been marked as a duplicate of this bug. ***
Comment 18•19 years ago
|
||
Checking in regress-309840.js;
/cvsroot/mozilla/js/tests/ecma_3/RegExp/regress-309840.js,v <-- regress-309840.js
initial revision: 1.1
done
obsoletes js1_5/Regress/regress-173067.js
Flags: testcase+
Comment 19•19 years ago
|
||
*** Bug 318303 has been marked as a duplicate of this bug. ***
Comment 20•19 years ago
|
||
verified fixed 200604-1 1.8.0.2, 1.8, 1.9a1 win/mac/linux
Status: RESOLVED → VERIFIED
Keywords: fixed1.8 → verified1.8
Comment 21•18 years ago
|
||
note to self: ecma_3/RegExp/regress-309840.js timed out on peach 1.8 debug browser, but not on prune. Could not reproduce manually.
You need to log in
before you can comment on or make changes to this bug.
Description
•