1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-23 23:35:45 +01:00

Remove useless boolean return values from _processHints.

And so begins the great "Returning booleans from every function as some
delusional attempt at error handling is insane"(TM) cleanup.
This commit is contained in:
Doug Kearns
2010-10-24 00:34:03 +11:00
parent c89df81725
commit 44e7b5aa55

View File

@@ -481,16 +481,13 @@ const Hints = Module("hints", {
* *
*/ */
_processHints: function _processHints(followFirst) { _processHints: function _processHints(followFirst) {
if (this._validHints.length == 0) { dactyl.assert(this._validHints.length > 0);
dactyl.beep();
return false;
}
// This "followhints" option is *too* confusing. For me, and // This "followhints" option is *too* confusing. For me, and
// presumably for users, too. --Kris // presumably for users, too. --Kris
if (options["followhints"] > 0) { if (options["followhints"] > 0) {
if (!followFirst) if (!followFirst)
return false; // no return hit; don't examine uniqueness return; // no return hit; don't examine uniqueness
// OK. return hit. But there's more than one hint, and // OK. return hit. But there's more than one hint, and
// there's no tab-selected current link. Do not follow in mode 2 // there's no tab-selected current link. Do not follow in mode 2
@@ -501,10 +498,10 @@ const Hints = Module("hints", {
let firstHref = this._validHints[0].getAttribute("href") || null; let firstHref = this._validHints[0].getAttribute("href") || null;
if (firstHref) { if (firstHref) {
if (this._validHints.some(function (e) e.getAttribute("href") != firstHref)) if (this._validHints.some(function (e) e.getAttribute("href") != firstHref))
return false; return;
} }
else if (this._validHints.length > 1) else if (this._validHints.length > 1)
return false; return;
} }
let timeout = followFirst || events.feedingKeys ? 0 : 500; let timeout = followFirst || events.feedingKeys ? 0 : 500;
@@ -535,7 +532,6 @@ const Hints = Module("hints", {
if (this._continue && this._top) if (this._continue && this._top)
this._showHints(); this._showHints();
}, timeout); }, timeout);
return true;
}, },
_checkUnique: function _checkUnique() { _checkUnique: function _checkUnique() {