Bug 771086 - Fix 4 strict warnings in toolkit/mozapps/extensions/content/extensions.js r=Unfocused
authorAbhishek Potnis <abhishekp.bugzilla@gmail.com>
Mon, 20 Aug 2012 07:26:00 +1200
changeset 108371 94b79a2eb30dd6845c418ac81ed2046339a38812
parent 108253 5b057a27cd0e77f2208705bdf9dad9624bb28dd7
child 108372 1f256d6070ac93baafd76373afc09774e63d5477
push idunknown
push userunknown
push dateunknown
reviewersUnfocused
bugs771086
milestone17.0a1
Bug 771086 - Fix 4 strict warnings in toolkit/mozapps/extensions/content/extensions.js r=Unfocused
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1472,18 +1472,18 @@ var gCategories = {
     category.setAttribute("id", "category-" + aId);
     category.setAttribute("value", aView);
     category.setAttribute("class", "category");
     category.setAttribute("name", aName);
     category.setAttribute("tooltiptext", aName);
     category.setAttribute("priority", aPriority);
     category.setAttribute("hidden", aStartHidden);
 
-    var node = this.node.firstChild;
-    while (node = node.nextSibling) {
+    var node;
+    for (node of this.node.children) {
       var nodePriority = parseInt(node.getAttribute("priority"));
       // If the new type's priority is higher than this one then this is the
       // insertion point
       if (aPriority < nodePriority)
         break;
       // If the new type's priority is lower than this one then this is isn't
       // the insertion point
       if (aPriority > nodePriority)
@@ -1645,17 +1645,17 @@ var gHeader = {
   _dest: "",
 
   initialize: function gHeader_initialize() {
     this._search = document.getElementById("header-search");
 
     this._search.addEventListener("command", function search_onCommand(aEvent) {
       var query = aEvent.target.value;
       if (query.length == 0)
-        return false;
+        return;
 
       gViewController.loadView("addons://search/" + encodeURIComponent(query));
     }, false);
 
     function updateNavButtonVisibility() {
       var shouldShow = gHeader.shouldShowNavButtons;
       document.getElementById("back-btn").hidden = !shouldShow;
       document.getElementById("forward-btn").hidden = !shouldShow;
@@ -2301,16 +2301,17 @@ var gSearchView = {
 
   getListItemForID: function gSearchView_getListItemForID(aId) {
     var listitem = this._listBox.firstChild;
     while (listitem) {
       if (listitem.getAttribute("status") == "installed" && listitem.mAddon.id == aId)
         return listitem;
       listitem = listitem.nextSibling;
     }
+    return null;
   }
 };
 
 
 var gListView = {
   node: null,
   _listBox: null,
   _emptyNotice: null,
@@ -2453,16 +2454,17 @@ var gListView = {
 
   getListItemForID: function gListView_getListItemForID(aId) {
     var listitem = this._listBox.firstChild;
     while (listitem) {
       if (listitem.getAttribute("status") == "installed" && listitem.mAddon.id == aId)
         return listitem;
       listitem = listitem.nextSibling;
     }
+    return null;
   }
 };
 
 
 var gDetailView = {
   node: null,
   _addon: null,
   _loadingTimer: null,