Closed Bug 613885 Opened 14 years ago Closed 13 years ago

RegExp pattern matching behaves different in FF4 than FF3

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 599854
Tracking Status
blocking2.0 --- final+

People

(Reporter: mail, Assigned: dmandelin)

Details

(Keywords: regression, Whiteboard: hardblocker)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b7) Gecko/20100101 Firefox/4.0b7
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b7) Gecko/20100101 Firefox/4.0b7

The below RegExp included in the Dojo Toolkit (dojox.html.set() method) works in FF3.6 and all other browsers but fails to match correctly in FF4b7.

Reproducible: Always

Steps to Reproduce:
/<script\s*(?![^>]*type=['"]?(?:dojo\/|text\/html\b))(?:[^>]*?(?:src=(['"]?)([^>]*?)\1[^>]*)?)*>([\s\S]*?)<\/script>/gi.exec('<script type="text/javascript" src="..."></script>');
Actual Results:  
["<script type="text/javascript" src="..."></script>", undefined, undefined, ""]

Expected Results:  
["<script type="text/javascript" src="..."></script>", """, "...", ""]

It works if I remove an unneeded (?:...)* expression as a workaround:

/<script\s*(?![^>]*type=['"]?(?:dojo\/|text\/html\b))[^>]*?(?:src=(['"]?)([^>]*?)\1[^>]*)?>([\s\S]*?)<\/script>/gi.exec('<script type="text/javascript" src="..."></script>');
blocking2.0: --- → ?
Assignee: general → cdleary
blocking2.0: ? → final+
Think this is a dup of bug 599854, will check later.
Keywords: regression
Whiteboard: hardblocker
Assignee: cdleary → dmandelin
Fixed by the patch for bug 599854. The test case in comment 0 is a test case in that patch, so it won't get forgotten.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.