Closed
Bug 107771
Opened 23 years ago
Closed 23 years ago
String.prototype.lastIndexOf counts on 0 termination of JSSTRING_CHARS
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla0.9.6
People
(Reporter: sean.schneyer, Assigned: brendan)
References
()
Details
(Keywords: js1.5, regression, testcase)
Attachments
(2 files)
677 bytes,
text/html
|
Details | |
551 bytes,
patch
|
brendan
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.5+) Gecko/20011030 BuildID: 2001103003 When going to the above URL, Javascript is used to redirect the user to https://web1.e-travel.com/etravel40/bin/ETWebDll.dll/welcome?UserGroup=ericsson In Mozilla, however, you are redirect to https://web1.e-travel.com/etravel40/bin/ETWebDll.dll/welcome?UserGroup= instead. The Javascript used is listed below: --- var path = new String(document.location); k = path.lastIndexOf('/'); if (k == path.length-1) { path = path.substring(0, k); k = path.lastIndexOf('/'); } var user_group = new String(path.substring(k+1, path.length)); var html = new String; html = '/etravel40/bin/ETWebDll.dll/welcome?UserGroup='; html += user_group; top.location.href = html; --- Reproducible: Always Steps to Reproduce: 1. Go to https://web1.e-travel.com/ericsson 2. Redirected to https://web1.e-travel.com/etravel40/bin/ETWebDll.dll/welcome?UserGroup= Actual Results: Redirected to wrong URL: https://web1.e-travel.com/etravel40/bin/ETWebDll.dll/welcome?UserGroup= Expected Results: Redirected to correct URL: https://web1.e-travel.com/etravel40/bin/ETWebDll.dll/welcome?UserGroup=ericsson
Comment 1•23 years ago
|
||
Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011031 Testcase in one moment.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Javascript URL redirect not written correctly → Javascript not updating variable quickly enough for method call
Comment 2•23 years ago
|
||
Comment 3•23 years ago
|
||
Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011031 This is a regression from Mozilla 0.9.5 milestone, which correctly evaluates this testcase.
Keywords: regression,
testcase
Assignee | ||
Comment 4•23 years ago
|
||
This stinks of my dependent string fix for bug 56940. /be
Assignee: rogerl → brendan
Keywords: js1.5,
mozilla0.9.6
Priority: -- → P1
Target Milestone: --- → mozilla0.9.6
Assignee | ||
Comment 5•23 years ago
|
||
Fixing summary. I hope there aren't more like this -- I'll look around. /be
Status: NEW → ASSIGNED
Summary: Javascript not updating variable quickly enough for method call → String.prototype.lastIndexOf counts on 0 termination of JSSTRING_CHARS
Assignee | ||
Comment 6•23 years ago
|
||
Assignee | ||
Comment 7•23 years ago
|
||
A `grep '[a-z]\[.* == [a-zA-Z_][a-zA-Z0-9_]*\[' js*.[ch]` shows no other such bad conditions. I think this is it. Our testcase failed to catch it, but will once phil creates a regression test for this bug. I have r=jag over my shoulder; jband, are you around? /be
Assignee | ||
Comment 8•23 years ago
|
||
Comment on attachment 56017 [details] [diff] [review] proposed fix, give me fast r= and sr= please! Got r=jag, sr=waterson, woohoo! /be
Attachment #56017 -
Flags: superreview+
Attachment #56017 -
Flags: review+
Assignee | ||
Comment 9•23 years ago
|
||
Fixed. /be
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•23 years ago
|
||
I am totally impressed with the turnaround on this fix! Thanks, I'm confirming that it works for me with the latest build.
Comment 11•23 years ago
|
||
Agreed -- Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011101 testcase now passes :)
Updated•23 years ago
|
Status: RESOLVED → VERIFIED
Comment 12•23 years ago
|
||
Testcase added to JS testsuite: mozilla/js/tests/js1_5/String/regress-107771.js Testcase passes in debug and optimized JS shells built 2001-11-01 WinNT. Based on this and the results indicated above, marking VERIFIED FIXED.
Updated•19 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•