Closed Bug 126810 Opened 24 years ago Closed 24 years ago

javascript strict warnings in sidebarOverlay.js

Categories

(SeaMonkey :: Sidebar, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stdowa+bugzilla, Assigned: stdowa+bugzilla)

References

Details

Attachments

(2 files)

Using today's trunk build. Warning: redeclaration of var tabs Source File: chrome://communicator/content/sidebar/sidebarOverlay.js Line: 1268, Column: 12 Source Code: var tabs = sidebarObj.panels.node.childNodes; Warning: redeclaration of var i Source File: chrome://communicator/content/sidebar/sidebarOverlay.js Line: 1346, Column: 13 Source Code: for (var i = 2; i < tabs.length; i += 2) Warning: redeclaration of var currHeader Source File: chrome://communicator/content/sidebar/sidebarOverlay.js Line: 1348, Column: 10 Source Code: var currHeader = tabs[i]; Warning: redeclaration of var currTab Source File: chrome://communicator/content/sidebar/sidebarOverlay.js Line: 1349, Column: 10 Source Code: var currTab = new sbPanel(currHeader.getAttribute("id"), currHeader, i);
Attached patch patchSplinter Review
Comment on attachment 70607 [details] [diff] [review] patch >Index: mozilla/xpfe/components/sidebar/resources/sidebarOverlay.js >=================================================================== >RCS file: /cvsroot/mozilla/xpfe/components/sidebar/resources/sidebarOverlay.js,v >retrieving revision 1.97 >diff -u -r1.97 sidebarOverlay.js >--- mozilla/xpfe/components/sidebar/resources/sidebarOverlay.js 2002/02/20 21:31:00 1.97 >+++ mozilla/xpfe/components/sidebar/resources/sidebarOverlay.js 2002/02/20 23:54:03 >@@ -1231,10 +1231,11 @@ > // if we ex/included a tab in view then add/remove another one > if (panel.is_in_view()) > { >+ var tabs = sidebarObj.panels.node.childNodes; > if (did_exclude) > { > // we excluded one so let's try to bring a non-excluded one into view >- var tabs = sidebarObj.panels.node.childNodes; >+ tabs = sidebarObj.panels.node.childNodes; If we have already set it to sidebarObj.panels.node.childNodes above we don't need to set it again. > var newFirst = null; > var added = false; > for (var i = 2; i < tabs.length ; i += 2) >@@ -1265,7 +1266,7 @@ > if (sidebarObj.panels.num_panels_in_view() > gNumTabsInViewPref) > { > // we included a new tab so let's take the last one out of view >- var tabs = sidebarObj.panels.node.childNodes; >+ tabs = sidebarObj.panels.node.childNodes; If we have already set it to sidebarObj.panels.node.childNodes above we don't need to set it again. > for (i = 2; i < tabs.length; i += 2) > { > var currHeader = tabs[i]; >@@ -1292,16 +1293,19 @@ > debug("SidebarNavigate " + aDirection); > > var tabs = sidebarObj.panels.node.childNodes; >+ var i = 2; Don't initalize it. Just declare it. It'll get initialized in the for loop. >+ var currHeader = tabs[i]; Don't initalize it. Just declare it. >+ var currTab = new sbPanel(currHeader.getAttribute("id"), currHeader, i); Don't initalize it. Just declare it.
Attachment #70607 - Flags: needs-work+
-> Stephen Walker
Assignee: sgehani → walk84
Attached patch patch rev. 2Splinter Review
*** Bug 127558 has been marked as a duplicate of this bug. ***
r=gemal on 70653 if if helps
Comment on attachment 70653 [details] [diff] [review] patch rev. 2 r=bzbarsky
Attachment #70653 - Flags: review+
Comment on attachment 70653 [details] [diff] [review] patch rev. 2 sr=jag
Attachment #70653 - Flags: superreview+
Comment on attachment 70653 [details] [diff] [review] patch rev. 2 a=scc
Attachment #70653 - Flags: approval+
Checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Stephen, can you verify this is fixed? thanks.
verified using a build from today on win2k.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: