зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1257246: Update browser for eslint 2. r=felipe
Most of this is fixing functions that in some cases return a value but then can also run to completion without returning anything. ESLint 2 catches this where previous versions didn't. Unless there was an obvious other choice I just made these functions return undefined at the end which is effectively what already happens. MozReview-Commit-ID: DEskVIjiKDM --HG-- extra : rebase_source : 07ba1d14655f5d761624b105ef025ec88323d4d5 extra : histedit_source : 9e5ab54ce1b1a5ee1f0fb143f8d1450522455e3b
This commit is contained in:
Родитель
5a830b3dbf
Коммит
4bf4f02ce7
|
@ -660,6 +660,7 @@ var LightweightThemeListener = {
|
|||
if (sheet.href == "chrome://browser/skin/browser-lightweightTheme.css")
|
||||
return sheet;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
|
||||
|
|
|
@ -11,7 +11,6 @@ var gPluginHandler = {
|
|||
"PluginContent:RemoveNotification",
|
||||
"PluginContent:UpdateHiddenPluginUI",
|
||||
"PluginContent:HideNotificationBar",
|
||||
"PluginContent:ShowInstallNotification",
|
||||
"PluginContent:InstallSinglePlugin",
|
||||
"PluginContent:ShowPluginCrashedNotification",
|
||||
"PluginContent:SubmitReport",
|
||||
|
@ -56,8 +55,6 @@ var gPluginHandler = {
|
|||
case "PluginContent:HideNotificationBar":
|
||||
this.hideNotificationBar(msg.target, msg.data.name);
|
||||
break;
|
||||
case "PluginContent:ShowInstallNotification":
|
||||
return this.showInstallNotification(msg.target, msg.data.pluginInfo);
|
||||
case "PluginContent:InstallSinglePlugin":
|
||||
this.installSinglePlugin(msg.data.pluginInfo);
|
||||
break;
|
||||
|
|
|
@ -251,7 +251,7 @@ var gSyncUI = {
|
|||
if (needsSetup || this._loginFailed()) {
|
||||
this.openSetup();
|
||||
} else {
|
||||
return this.doSync();
|
||||
this.doSync();
|
||||
}
|
||||
}).catch(err => {
|
||||
this.log.error("Failed to handle toolbar button command", err);
|
||||
|
|
|
@ -3366,7 +3366,7 @@ const DOMLinkHandler = {
|
|||
addSearch: function(aBrowser, aEngine, aURL) {
|
||||
let tab = gBrowser.getTabForBrowser(aBrowser);
|
||||
if (!tab)
|
||||
return false;
|
||||
return;
|
||||
|
||||
BrowserSearch.addEngine(aBrowser, aEngine, makeURI(aURL));
|
||||
},
|
||||
|
|
|
@ -268,6 +268,7 @@ function getClipboardHelper() {
|
|||
return Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
|
||||
} catch(e) {
|
||||
// do nothing, later code will handle the error
|
||||
return null;
|
||||
}
|
||||
}
|
||||
const gClipboardHelper = getClipboardHelper();
|
||||
|
|
|
@ -603,6 +603,7 @@ Sanitizer.prototype = {
|
|||
aWindow.skipNextCanClose = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
_resetAllWindowClosures: function(aWindowList) {
|
||||
for (let win of aWindowList) {
|
||||
|
@ -665,6 +666,7 @@ Sanitizer.prototype = {
|
|||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
newWindow.addEventListener("fullscreen", onFullScreen);
|
||||
}
|
||||
|
|
|
@ -147,6 +147,7 @@ var Change = {
|
|||
return this.doChangePassword();
|
||||
break;
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
doGeneratePassphrase: function () {
|
||||
|
|
|
@ -123,14 +123,14 @@ var gSyncSetup = {
|
|||
|
||||
startNewAccountSetup: function () {
|
||||
if (!Weave.Utils.ensureMPUnlocked())
|
||||
return false;
|
||||
return;
|
||||
this._settingUpNew = true;
|
||||
this.wizard.pageIndex = NEW_ACCOUNT_START_PAGE;
|
||||
},
|
||||
|
||||
useExistingAccount: function () {
|
||||
if (!Weave.Utils.ensureMPUnlocked())
|
||||
return false;
|
||||
return;
|
||||
this._settingUpNew = false;
|
||||
if (this.wizardType == "pair") {
|
||||
// We're already pairing, so there's no point in pairing again.
|
||||
|
|
|
@ -4314,6 +4314,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
return undefined;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
|
@ -2134,7 +2134,8 @@ var CustomizableUIInternal = {
|
|||
|
||||
dispatchToolboxEvent: function(aEventType, aDetails={}, aWindow=null) {
|
||||
if (aWindow) {
|
||||
return this._dispatchToolboxEventToWindow(aEventType, aDetails, aWindow);
|
||||
this._dispatchToolboxEventToWindow(aEventType, aDetails, aWindow);
|
||||
return;
|
||||
}
|
||||
for (let [win, ] of gBuildWindows) {
|
||||
this._dispatchToolboxEventToWindow(aEventType, aDetails, win);
|
||||
|
@ -2418,6 +2419,7 @@ var CustomizableUIInternal = {
|
|||
aArgs);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -3912,7 +3914,7 @@ function XULWidgetGroupWrapper(aWidgetId) {
|
|||
});
|
||||
|
||||
this.__defineGetter__("instances", function() {
|
||||
return Array.from(gBuildWindows, ([win,]) => this.forWindow(win));
|
||||
return Array.from(gBuildWindows, (wins) => this.forWindow(wins[0]));
|
||||
});
|
||||
|
||||
Object.freeze(this);
|
||||
|
|
|
@ -128,6 +128,7 @@ function checkBookmarksItemsChevronContextMenu() {
|
|||
if (child.style.visibility != "hidden")
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
yield checkPlacesContextMenu(chevronPopup);
|
||||
info("Waiting for bookmark toolbar item chevron popup to close");
|
||||
|
|
|
@ -478,6 +478,7 @@ ESEDB.prototype = {
|
|||
systemTime.wSecond,
|
||||
systemTime.wMilliseconds));
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
_getColumnInfo(tableName, columns) {
|
||||
|
|
|
@ -872,6 +872,7 @@ WindowsVaultFormPasswords.prototype = {
|
|||
if (aOnlyCheckExists) {
|
||||
return false;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -161,6 +161,7 @@ var MigrationWizard = {
|
|||
else
|
||||
this._selectedProfile = null;
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
// 2 - [Profile Selection]
|
||||
|
|
|
@ -27,6 +27,7 @@ function waitForConditionPromise(condition, timeoutMsg, tryCount=NUMBER_OF_TRIES
|
|||
}
|
||||
tries++;
|
||||
setTimeout(checkCondition, SINGLE_TRY_TIMEOUT);
|
||||
return undefined;
|
||||
}
|
||||
setTimeout(checkCondition, SINGLE_TRY_TIMEOUT);
|
||||
return defer.promise;
|
||||
|
|
|
@ -1822,6 +1822,7 @@ Experiments.ExperimentEntry.prototype = {
|
|||
this._log.error("_installAddon() - onInstallStarted, wrong addon type");
|
||||
return false;
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
onInstallEnded: install => {
|
||||
|
|
|
@ -21,6 +21,7 @@ function waitForConditionPromise(condition, timeoutMsg, tryCount=NUMBER_OF_TRIES
|
|||
}
|
||||
tries++;
|
||||
setTimeout(checkCondition, SINGLE_TRY_TIMEOUT);
|
||||
return undefined;
|
||||
}
|
||||
setTimeout(checkCondition, SINGLE_TRY_TIMEOUT);
|
||||
return defer.promise;
|
||||
|
|
|
@ -24,6 +24,7 @@ this.TabsInTitlebar = {
|
|||
return Promise.reject("TabsInTitlebar isn't supported on Linux");
|
||||
}
|
||||
Services.prefs.setBoolPref(PREF_TABS_IN_TITLEBAR, true);
|
||||
return undefined;
|
||||
}),
|
||||
},
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ this.Toolbars = {
|
|||
if (browserWindow.fullScreen) {
|
||||
return Promise.reject("The bookmark toolbar and menubar are not shown in fullscreen.");
|
||||
}
|
||||
return undefined;
|
||||
}),
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче