зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1329017 - Enable the no-useless-return rule for eslint and use eslint --fix to autofix the errors. r=standard8
MozReview-Commit-ID: 2MhpvzUDgtK --HG-- extra : rebase_source : 1df2b81badfe556928f6424c8990e4b3fde7056f
This commit is contained in:
Родитель
43cacee3a5
Коммит
b33bfba51a
|
@ -292,7 +292,6 @@ function loadSnippets() {
|
|||
} catch (ex) {
|
||||
showSnippets();
|
||||
loadCompleted();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
showSnippets();
|
||||
|
|
|
@ -104,7 +104,6 @@ var gDataNotificationInfoBar = {
|
|||
this._displayDataPolicyInfoBar(request);
|
||||
} catch (ex) {
|
||||
request.onUserNotifyFailed(ex);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -96,7 +96,6 @@ add_task(function* panel_shown_for_once_for_doubleclick_on_new_bookmark_star_and
|
|||
add_task(function* panel_shown_once_for_slow_doubleclick_on_new_bookmark_star_and_autocloses() {
|
||||
todo(false, "bug 1250267, may need to add some tracking state to " +
|
||||
"browser-places.js for this.");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_bookmarks_popup({
|
||||
|
|
|
@ -62,7 +62,7 @@ var gProgressListener = {
|
|||
|
||||
function test() {
|
||||
todo(false, "temp. disabled");
|
||||
return; /* FIXME */
|
||||
/* FIXME */
|
||||
/*
|
||||
waitForExplicitFinish();
|
||||
// Wait for all tabs to finish loading
|
||||
|
|
|
@ -374,7 +374,6 @@ add_task(function* test_textarea() {
|
|||
// Disabled since this is seeing spell-check-enabled
|
||||
// instead of spell-add-dictionaries-main
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-textarea",
|
||||
|
@ -398,7 +397,6 @@ add_task(function* test_textarea() {
|
|||
|
||||
add_task(function* test_textarea_spellcheck() {
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-textarea",
|
||||
|
@ -438,7 +436,6 @@ add_task(function* test_plaintext2() {
|
|||
|
||||
add_task(function* test_undo_add_to_dictionary() {
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-textarea",
|
||||
|
@ -472,7 +469,6 @@ add_task(function* test_undo_add_to_dictionary() {
|
|||
|
||||
add_task(function* test_contenteditable() {
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-contenteditable",
|
||||
|
@ -726,7 +722,6 @@ add_task(function* test_imagelink() {
|
|||
|
||||
add_task(function* test_select_input_text() {
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-select-input-text",
|
||||
|
@ -759,7 +754,6 @@ add_task(function* test_select_input_text() {
|
|||
|
||||
add_task(function* test_select_input_text_password() {
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-select-input-text-type-password",
|
||||
|
@ -878,7 +872,6 @@ add_task(function* test_srcdoc() {
|
|||
|
||||
add_task(function* test_input_spell_false() {
|
||||
todo(false, "spell checker tests are failing, bug 1246296");
|
||||
return;
|
||||
|
||||
/*
|
||||
yield test_contextmenu("#test-contenteditable-spellcheck-false",
|
||||
|
|
|
@ -491,7 +491,6 @@ function whenSearchInitDone() {
|
|||
// Wait for the search controller to receive the event, then resolve.
|
||||
if (content.gSearch._contentSearchController.defaultEngine) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
}
|
||||
content.setTimeout(resolver, 0);
|
||||
|
|
|
@ -917,7 +917,6 @@ const CustomizableWidgets = [
|
|||
if (!gotView) {
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
},
|
||||
onCreated(node) {
|
||||
|
|
|
@ -122,7 +122,6 @@ add_task(function* test_pinned() {
|
|||
// Remove created tab.
|
||||
browser.tabs.remove(tabId);
|
||||
browser.test.notifyPass("finish");
|
||||
return;
|
||||
}
|
||||
});
|
||||
browser.tabs.update(tab.id, {pinned: true});
|
||||
|
@ -144,7 +143,6 @@ add_task(function* test_unpinned() {
|
|||
// Remove created tab.
|
||||
browser.tabs.remove(tabId);
|
||||
browser.test.notifyPass("finish");
|
||||
return;
|
||||
}
|
||||
});
|
||||
browser.tabs.update(tab.id, {pinned: false});
|
||||
|
@ -167,7 +165,6 @@ add_task(function* test_url() {
|
|||
// Remove created tab.
|
||||
browser.tabs.remove(tabId);
|
||||
browser.test.notifyPass("finish");
|
||||
return;
|
||||
}
|
||||
});
|
||||
browser.tabs.update(tab.id, {url: "about:blank"});
|
||||
|
|
|
@ -82,7 +82,7 @@ add_task(function* tabsSendMessageReply() {
|
|||
} else if (msg == "respond-promise") {
|
||||
return Promise.resolve(msg);
|
||||
} else if (msg == "respond-never") {
|
||||
return;
|
||||
return undefined;
|
||||
} else if (msg == "respond-error") {
|
||||
return Promise.reject(new Error(msg));
|
||||
} else if (msg == "throw-error") {
|
||||
|
|
|
@ -42,7 +42,6 @@ var SidebarUtils = {
|
|||
|
||||
if (aEvent.button == 0 && isContainer && !openInTabs) {
|
||||
tbo.view.toggleOpenState(cell.row);
|
||||
return;
|
||||
} else if (!mouseInGutter && openInTabs &&
|
||||
aEvent.originalTarget.localName == "treechildren") {
|
||||
tbo.view.selection.select(cell.row);
|
||||
|
|
|
@ -121,7 +121,6 @@ gTests.push({
|
|||
break;
|
||||
default:
|
||||
ok(false, "unknown event: " + aEvent.type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -223,7 +222,6 @@ gTests.push({
|
|||
break;
|
||||
default:
|
||||
ok(false, "unknown event: " + aEvent.type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -87,13 +87,6 @@ var gBlocklistManager = {
|
|||
|
||||
document.title = params.windowTitle;
|
||||
|
||||
let treecols = document.getElementsByTagName("treecols")[0];
|
||||
treecols.addEventListener("click", event => {
|
||||
if (event.target.nodeName != "treecol" || event.button != 0) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
this._loadBlockLists();
|
||||
},
|
||||
|
||||
|
|
|
@ -197,7 +197,6 @@ var gMainPane = {
|
|||
return;
|
||||
case CONFIRM_RESTART_PROMPT_RESTART_LATER:
|
||||
createOrRemoveSpecialDevEditionFile();
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -155,7 +155,6 @@ add_task(function* testAltReturn() {
|
|||
|
||||
// Shift key has no effect for now, so skip it
|
||||
add_task(function* testShiftAltReturn() {
|
||||
return;
|
||||
/*
|
||||
yield* prepareTest();
|
||||
|
||||
|
|
|
@ -1951,7 +1951,6 @@ this.UITour = {
|
|||
ReaderParent.showReaderModeInfoPanel(browser);
|
||||
} else {
|
||||
log.error("startSubTour: Unknown feature option specified");
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -2031,7 +2030,6 @@ this.UITour = {
|
|||
}
|
||||
}
|
||||
reject("selectSearchEngine could not find engine with given ID");
|
||||
return;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -45,8 +45,6 @@ AboutPocketChildListener.prototype = {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -256,7 +256,6 @@ this.ContentSearch = {
|
|||
}
|
||||
win.BrowserSearch.recordSearchInTelemetry(engine, data.healthReportKey,
|
||||
{ selection: data.selection });
|
||||
return;
|
||||
},
|
||||
|
||||
getSuggestions: Task.async(function* (engineName, searchString, browser) {
|
||||
|
|
|
@ -64,7 +64,6 @@ let LaterRun = {
|
|||
if (this.hoursSinceInstall > kSelfDestructHoursLimit ||
|
||||
this.sessionCount > kSelfDestructSessionLimit) {
|
||||
this.selfDestruct();
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -202,6 +202,9 @@ module.exports = {
|
|||
// Disallow unnecessary .call() and .apply()
|
||||
"no-useless-call": "error",
|
||||
|
||||
// Disallow redundant return statements
|
||||
"no-useless-return": "error",
|
||||
|
||||
// No using with
|
||||
"no-with": "error",
|
||||
|
||||
|
|
|
@ -241,7 +241,6 @@ _ContextualIdentityService.prototype = {
|
|||
}
|
||||
} catch (error) {
|
||||
this.loadError(error);
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ add_task(function* tabsSendMessageReply() {
|
|||
} else if (msg == "respond-promise") {
|
||||
return Promise.resolve(msg);
|
||||
} else if (msg == "respond-never") {
|
||||
return;
|
||||
return undefined;
|
||||
} else if (msg == "respond-error") {
|
||||
return Promise.reject(new Error(msg));
|
||||
} else if (msg == "throw-error") {
|
||||
|
|
|
@ -51,11 +51,8 @@
|
|||
if (topic === "domwindowopened") {
|
||||
this.windowsOpen++;
|
||||
this.windowsRegistered++;
|
||||
return;
|
||||
}
|
||||
if (topic === "domwindowclosed") {
|
||||
} else if (topic === "domwindowclosed") {
|
||||
this.windowsOpen--;
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -130,7 +130,6 @@ function AlertListener(accept, {register, unregister}) {
|
|||
}
|
||||
this.result = result;
|
||||
this.triggered = true;
|
||||
return;
|
||||
};
|
||||
this.triggered = false;
|
||||
this.result = null;
|
||||
|
|
|
@ -133,7 +133,6 @@ add_task(function* test_remove_single() {
|
|||
} finally {
|
||||
yield PlacesTestUtils.clearHistory();
|
||||
}
|
||||
return;
|
||||
});
|
||||
|
||||
// Test removing a list of pages
|
||||
|
|
|
@ -1023,7 +1023,6 @@ function runTest() {
|
|||
default:
|
||||
ok(false, "Unexpected invocation of test #" + testNum);
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -479,7 +479,6 @@ function runTest() {
|
|||
default:
|
||||
ok(false, "Unexpected invocation of test #" + testNum);
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -335,7 +335,6 @@ var gViewSourceUtils = {
|
|||
// we failed loading it with the external editor.
|
||||
Components.utils.reportError(ex);
|
||||
this.handleCallBack(aCallBack, false, data);
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ function worker_handler(worker) {
|
|||
return;
|
||||
default:
|
||||
SimpleTest.ok(false, "test_osfile.xul: wrong message " + JSON.stringify(msg.data));
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ function worker_handler(worker) {
|
|||
return;
|
||||
default:
|
||||
SimpleTest.ok(false, "test_osfile.xul: wrong message " + JSON.stringify(msg.data));
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ function finish() {
|
|||
return;
|
||||
}
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
function ok(condition, message) {
|
||||
|
|
|
@ -199,7 +199,6 @@ IDService.prototype = {
|
|||
}
|
||||
self.RP._doLogin(rp, rpLoginOptions, assertion);
|
||||
self.RP._cleanUpProvisionFlow(aRPId, aProvId);
|
||||
return;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -885,7 +885,6 @@ function _persistProgressListener(successCallback) {
|
|||
if (aRequest.QueryInterface(Ci.nsIHttpChannel).requestSucceeded) {
|
||||
// success
|
||||
successCallback();
|
||||
return;
|
||||
}
|
||||
} catch (e) { }
|
||||
// failure
|
||||
|
|
|
@ -2061,7 +2061,6 @@ var gHeader = {
|
|||
onKeyPress(aEvent) {
|
||||
if (String.fromCharCode(aEvent.charCode) == "/") {
|
||||
this.focusSearchBox();
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -1941,7 +1941,6 @@ function removeAsync(aFile) {
|
|||
if (!(e instanceof OS.File.Error) || !e.becauseNoSuchFile)
|
||||
throw e;
|
||||
// The file has already gone away
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -936,7 +936,6 @@ Blocklist.prototype = {
|
|||
}
|
||||
} catch (e) {
|
||||
LOG("Blocklist::_loadBlocklistFromFile: Error constructing blocklist " + e);
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ add_task(function* canUndoUninstallDisabled() {
|
|||
// Tests that uninstalling an enabled lightweight theme offers the option to undo
|
||||
add_task(function* uninstallLWTOffersUndo() {
|
||||
// skipped since lightweight themes don't support undoable uninstall yet
|
||||
return;
|
||||
|
||||
/*
|
||||
LightweightThemeManager.currentTheme = dummyLWTheme("theme1");
|
||||
|
||||
|
|
|
@ -196,8 +196,6 @@ function setPasswordStrength() {
|
|||
|
||||
var mymeter = document.getElementById('pwmeter');
|
||||
mymeter.value = pwstrength;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function checkPasswords() {
|
||||
|
|
|
@ -2082,7 +2082,6 @@ UpdateService.prototype = {
|
|||
let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
|
||||
createInstance(Ci.nsIUpdatePrompt);
|
||||
prompter.showUpdateElevationRequired();
|
||||
return;
|
||||
} else {
|
||||
// If there was an I/O error it is assumed that the patch is not invalid
|
||||
// and it is set to pending so an attempt to apply it again will happen
|
||||
|
|
Загрузка…
Ссылка в новой задаче