Closed
Bug 483821
Opened 17 years ago
Closed 17 years ago
TM: Unexpected result when using "\x7e" to represent a character in a string
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.9.2a1
People
(Reporter: bit, Assigned: dmandelin)
References
Details
(Keywords: verified1.9.1)
Attachments
(1 file)
|
602 bytes,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3 (.NET CLR 3.5.30729)
I am using regular expressions to replace certain characters in a string. When using FF 3.1b3 with javascript.options.jit.content set to true, the output is not correct.
Reproducible: Always
Steps to Reproduce:
var re1 = new RegExp("\\x25","gi");
var re2 = new RegExp("\\x7e","gi");
var re3 = new RegExp("\~","gi");
alert("~%".match(re1));//alerts %
alert("~%".match(re2));//should alert ~, instead alerts %
alert("~%".match(re3));//alerts ~
Actual Results:
alerted %, %, and ~
Expected Results:
alerted %, ~, and ~
setting javascript.options.jit.content to false fixes this problem.
Updated•17 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Summary: Unexpected result when using "/x7e" to represent a character in a string → TM: Unexpected result when using "/x7e" to represent a character in a string
Version: unspecified → 1.9.1 Branch
Updated•17 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.9.1?
Updated•17 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
| Assignee | ||
Comment 1•17 years ago
|
||
Key compare was busted because it compared the first n bytes instead of the first n chars of the regexp source text.
Comment 2•17 years ago
|
||
Comment on attachment 367921 [details] [diff] [review]
Patch
Ouch.
Attachment #367921 -
Flags: review?(gal) → review+
| Assignee | ||
Comment 3•17 years ago
|
||
Pushed to TM as c923f9ce63ee.
Comment 4•17 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 7•17 years ago
|
||
As given by the duped bug 483270 this will probably affect several websites. Raising severity to major.
URL: http://any/url/
Severity: normal → major
OS: Windows XP → All
Hardware: x86 → All
Target Milestone: --- → mozilla1.9.2a1
Updated•17 years ago
|
Summary: TM: Unexpected result when using "/x7e" to represent a character in a string → TM: Unexpected result when using "\x7e" to represent a character in a string
Comment 8•17 years ago
|
||
fixed1.9.1 long ago:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/78dda33b5e43
Keywords: fixed1.9.1
Comment 9•17 years ago
|
||
Verified on trunk and 1.9.1 with following builds:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090519 Minefield/3.6a1pre
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090519 Shiretoko/3.5b5pre ID:20090519035556
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•