Closed
Bug 60628
Opened 24 years ago
Closed 24 years ago
javascript strict warnings in tabBindings.xml
Categories
(SeaMonkey :: MailNews: Address Book & Contacts, defect, P3)
SeaMonkey
MailNews: Address Book & Contacts
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: bugzilla, Assigned: maolson)
Details
Attachments
(5 files)
1.05 KB,
patch
|
Details | Diff | Splinter Review | |
3.23 KB,
patch
|
Details | Diff | Splinter Review | |
3.44 KB,
patch
|
Details | Diff | Splinter Review | |
1.97 KB,
patch
|
Details | Diff | Splinter Review | |
3.23 KB,
patch
|
Details | Diff | Splinter Review |
JavaScript strict warning: chrome://global/content/tabBindings.xml#tabbox.selectedTab (getter) line 7: function onget does not always return a value
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
This patch is mostly whitespace and formatting, the interesing diff is that we now return 0 as a fallback.
Comment 5•24 years ago
|
||
You can get rid of the getAttribute here. If all is well, that childNode is a <tab/> which has an xbl property "selected", which does the getAttribute and setAttribute for you (though in this case it actually does a bit more, see the actual implementation of it). If not all is well, then trying to access .selected will cause an exception to be thrown. Also, elsewhere something similar is done for .selected = false and removeAttribute, could you fix that while you're at it?
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
now instead of return 0; we are throwing an exception since there should not eb a case where we have no selected tab.
Comment 8•24 years ago
|
||
We may need to check some of the related code to make sure "no tab selected" indeed never happens. Apparantly, tabcontrol's selectedTab setter doesn't check for null, and tabbox's selectedTab looks slighty broken to me (it will only set the right index if the tab already was selected). It does however use val.selected meaning setting selectedTab to null will give you an exception. One problem could be not having a tab marked as selected in the xul code, so perhaps tabbox's bindingattached should set the first tab to selected then (and make sure only one tab is selected)?
Comment 9•24 years ago
|
||
Okay, ignore that last bit, I completely missed: // and also need to select first tab on startup. ... this.selectedTab = tabs[0]; That's what you get for short nights. So then I guess we can safely say a tab should be selected at any time and thus one not being selected is indeed a FAILURE. Perhaps we should make this more clear by throwing NS_ERROR_NULL_POINTER in the selectedTab setter(s)?
Assignee | ||
Comment 10•24 years ago
|
||
Comment 11•24 years ago
|
||
r=jag
Comment 12•24 years ago
|
||
cc'ing alec for sr
Assignee | ||
Updated•24 years ago
|
Comment 13•24 years ago
|
||
can I get a diff -bw? looks like lots of whitespaces fixes
Assignee | ||
Comment 14•24 years ago
|
||
Comment 15•24 years ago
|
||
argh, sorry to be a stickler, but I meant cvs diff -bw -u (i.e. still a unified diff, but ignoring whitespaces - I know that's not obvious but for future reference, this is what people mean by a "diff -bw" :))
Assignee | ||
Comment 16•24 years ago
|
||
Comment 17•24 years ago
|
||
oops, I meant to sr= this yesterday. sr=alecf
Comment 18•24 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 19•23 years ago
|
||
With Suresh's help, using a debug build, NT4 and build on 3-2-01 this is fixed. Verified.
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•