Closed Bug 459378 Opened 16 years ago Closed 16 years ago

JS Replace function working incorrectly

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED INVALID

People

(Reporter: java.deepak, Unassigned)

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SU 3.1; QS 4.2.2.3; .NET CLR 1.1.4322) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 Check this script: <script language="javascript"> x = "$$john"; y = "~1"; result = "~1 hello"; result = result.replace(y, x); alert(result); </script> in the output I loose one '$' sign.It works fine in IE.. IE Output: $$john hello Mozilla Output: $john hello Can you please inform me by mail(java.deepak@gmail.com) what is the issue? Reproducible: Always Steps to Reproduce: Run the script given in details Actual Results: IE Output: $$john hello Mozilla Output: $john hello Expected Results: $$john hello
This might nonetheless get fixed in bug 432525.
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
No, we're not going to break our spec compliance in that bug, just improve the speed of what we do with flat-string replaces.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Is there any way to escape this special pattern and replace a '$$' like value in an input string please? To support cross browser gets really tough at times. Since you guys already closed this can u please let me know by mail...i mean if you have some time to reply.
You need to log in before you can comment on or make changes to this bug.