Closed
Bug 107771
Opened 24 years ago
Closed 24 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•24 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•24 years ago
|
||
Comment 3•24 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•24 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•24 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•24 years ago
|
||
| Assignee | ||
Comment 7•24 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•24 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•24 years ago
|
||
Fixed.
/be
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 10•24 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•24 years ago
|
||
Agreed -- Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+)
Gecko/20011101 testcase now passes :)
Updated•24 years ago
|
Status: RESOLVED → VERIFIED
Comment 12•24 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•20 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•