Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 6a07a42

Browse files
committed
Bug 1314343: Turn on no-unreachable in eslint. r=standard8
Unreachable code can be a sign of a mistake so we should turn this rule on. MozReview-Commit-ID: LQphsNL7HBX --HG-- extra : rebase_source : eb5fdb1157cac6e447492ac89bb15d83dc32eef6
1 parent 94452e0 commit 6a07a42

35 files changed

Lines changed: 32 additions & 58 deletions

browser/base/content/browser-gestureSupport.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,6 @@ var gHistorySwipeAnimation = {
854854
catch (ex) {
855855
return false;
856856
}
857-
return true;
858857
},
859858

860859
/**

browser/base/content/sync/genericChange.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ var Change = {
141141
case "UpdatePassphrase":
142142
case "ResetPassphrase":
143143
return this.doChangePassphrase();
144-
break;
145144
case "ChangePassword":
146145
return this.doChangePassword();
147-
break;
148146
}
149147
return undefined;
150148
},

browser/base/content/test/general/browser_bookmark_popup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ add_task(function* panel_shown_once_for_slow_doubleclick_on_new_bookmark_star_an
9898
"browser-places.js for this.");
9999
return;
100100

101+
/*
101102
yield test_bookmarks_popup({
102103
isNewBookmark: true,
103104
*popupShowFn() {
@@ -108,6 +109,7 @@ add_task(function* panel_shown_once_for_slow_doubleclick_on_new_bookmark_star_an
108109
shouldAutoClose: true,
109110
isBookmarkRemoved: false,
110111
});
112+
*/
111113
});
112114

113115
add_task(function* panel_shown_for_keyboardshortcut_on_new_bookmark_star_and_autocloses() {

browser/base/content/test/general/browser_bug356571.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ var gProgressListener = {
6363
function test() {
6464
todo(false, "temp. disabled");
6565
return; /* FIXME */
66+
/*
6667
waitForExplicitFinish();
6768
// Wait for all tabs to finish loading
6869
gBrowser.addTabsProgressListener(gProgressListener);
6970
loadOneOrMoreURIs(kURIs.join("|"));
71+
*/
7072
}
7173

7274
function finishTest() {

browser/base/content/test/general/browser_contextmenu.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ add_task(function* test_textarea() {
375375
todo(false, "spell checker tests are failing, bug 1246296");
376376
return;
377377

378+
/*
378379
yield test_contextmenu("#test-textarea",
379380
["context-undo", false,
380381
"---", null,
@@ -391,12 +392,14 @@ add_task(function* test_textarea() {
391392
skipFocusChange: true,
392393
}
393394
);
395+
*/
394396
});
395397

396398
add_task(function* test_textarea_spellcheck() {
397399
todo(false, "spell checker tests are failing, bug 1246296");
398400
return;
399401

402+
/*
400403
yield test_contextmenu("#test-textarea",
401404
["*chubbiness", true, // spelling suggestion
402405
"spell-add-to-dictionary", true,
@@ -425,6 +428,7 @@ add_task(function* test_textarea_spellcheck() {
425428
}
426429
}
427430
);
431+
*/
428432
});
429433

430434
add_task(function* test_plaintext2() {
@@ -435,6 +439,7 @@ add_task(function* test_undo_add_to_dictionary() {
435439
todo(false, "spell checker tests are failing, bug 1246296");
436440
return;
437441

442+
/*
438443
yield test_contextmenu("#test-textarea",
439444
["spell-undo-add-to-dictionary", true,
440445
"---", null,
@@ -461,12 +466,14 @@ add_task(function* test_undo_add_to_dictionary() {
461466
}
462467
}
463468
);
469+
*/
464470
});
465471

466472
add_task(function* test_contenteditable() {
467473
todo(false, "spell checker tests are failing, bug 1246296");
468474
return;
469475

476+
/*
470477
yield test_contextmenu("#test-contenteditable",
471478
["spell-no-suggestions", false,
472479
"spell-add-to-dictionary", true,
@@ -488,6 +495,7 @@ add_task(function* test_contenteditable() {
488495
],
489496
{waitForSpellCheck: true}
490497
);
498+
*/
491499
});
492500

493501
add_task(function* test_copylinkcommand() {
@@ -719,6 +727,7 @@ add_task(function* test_select_input_text() {
719727
todo(false, "spell checker tests are failing, bug 1246296");
720728
return;
721729

730+
/*
722731
yield test_contextmenu("#test-select-input-text",
723732
["context-undo", false,
724733
"---", null,
@@ -744,12 +753,14 @@ add_task(function* test_select_input_text() {
744753
}
745754
}
746755
);
756+
*/
747757
});
748758

749759
add_task(function* test_select_input_text_password() {
750760
todo(false, "spell checker tests are failing, bug 1246296");
751761
return;
752762

763+
/*
753764
yield test_contextmenu("#test-select-input-text-type-password",
754765
["context-undo", false,
755766
"---", null,
@@ -785,6 +796,7 @@ add_task(function* test_select_input_text_password() {
785796
}
786797
}
787798
);
799+
*/
788800
});
789801

790802
add_task(function* test_click_to_play_blocked_plugin() {
@@ -867,6 +879,7 @@ add_task(function* test_input_spell_false() {
867879
todo(false, "spell checker tests are failing, bug 1246296");
868880
return;
869881

882+
/*
870883
yield test_contextmenu("#test-contenteditable-spellcheck-false",
871884
["context-undo", false,
872885
"---", null,
@@ -878,6 +891,7 @@ add_task(function* test_input_spell_false() {
878891
"context-selectall", true,
879892
]
880893
);
894+
*/
881895
});
882896

883897
const remoteClientsFixture = [ { id: 1, name: "Foo"}, { id: 2, name: "Bar"} ];

browser/base/content/test/general/browser_sanitize-timespans.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function countEntries(name, message, check) {
5959
let count;
6060
FormHistory.count(obj, { handleResult: result => count = result,
6161
handleError: function (error) {
62-
throw new Error("Error occurred searching form history: " + error);
6362
deferred.reject(error)
63+
throw new Error("Error occurred searching form history: " + error);
6464
},
6565
handleCompletion: function (reason) {
6666
if (!reason) {
@@ -494,8 +494,8 @@ function* setupFormHistory() {
494494
let results = [];
495495
FormHistory.search(terms, params, { handleResult: result => results.push(result),
496496
handleError: function (error) {
497-
throw new Error("Error occurred searching form history: " + error);
498497
deferred.reject(error);
498+
throw new Error("Error occurred searching form history: " + error);
499499
},
500500
handleCompletion: function (reason) { deferred.resolve(results); }
501501
});
@@ -506,8 +506,8 @@ function* setupFormHistory() {
506506
{
507507
let deferred = Promise.defer();
508508
FormHistory.update(changes, { handleError: function (error) {
509-
throw new Error("Error occurred searching form history: " + error);
510509
deferred.reject(error);
510+
throw new Error("Error occurred searching form history: " + error);
511511
},
512512
handleCompletion: function (reason) { deferred.resolve(); }
513513
});

browser/base/content/test/general/browser_sanitizeDialog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,8 @@ function promiseAddFormEntryWithMinutesAgo(aMinutesAgo) {
901901
return new Promise((resolve, reject) =>
902902
FormHistory.update({ op: "add", fieldname: name, value: "dummy", firstUsed: timestamp },
903903
{ handleError: function (error) {
904-
throw new Error("Error occurred updating form history: " + error);
905904
reject();
905+
throw new Error("Error occurred updating form history: " + error);
906906
},
907907
handleCompletion: function (reason) {
908908
resolve(name);
@@ -921,8 +921,8 @@ function formNameExists(name)
921921
FormHistory.count({ fieldname: name },
922922
{ handleResult: result => count = result,
923923
handleError: function (error) {
924-
throw new Error("Error occurred searching form history: " + error);
925924
reject(error);
925+
throw new Error("Error occurred searching form history: " + error);
926926
},
927927
handleCompletion: function (reason) {
928928
if (!reason) {
@@ -952,8 +952,8 @@ function* blankSlate() {
952952
}
953953
},
954954
handleError(error) {
955-
throw new Error("Error occurred updating form history: " + error);
956955
reject(error);
956+
throw new Error("Error occurred updating form history: " + error);
957957
}
958958
});
959959
});

browser/base/content/test/general/browser_web_channel.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
break;
3939
default:
4040
throw new Error(`INVALID TEST NAME ${testName}`);
41-
break;
4241
}
4342
};
4443

browser/base/content/test/general/browser_web_channel_iframe.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
break;
2323
default:
2424
throw new Error(`INVALID TEST NAME ${testName}`);
25-
break;
2625
}
2726
};
2827

browser/base/content/test/popupNotifications/browser_popupNotification_3.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ var tests = [
278278
info("notifyObj1.options.eventCallback: " + eventName);
279279
if (eventName == "dismissed") {
280280
throw new Error("Oops 1!");
281-
if (++callbackCount == 2) {
282-
goNext();
283-
}
284281
}
285282
};
286283

@@ -291,9 +288,6 @@ var tests = [
291288
info("notifyObj2.options.eventCallback: " + eventName);
292289
if (eventName == "dismissed") {
293290
throw new Error("Oops 2!");
294-
if (++callbackCount == 2) {
295-
goNext();
296-
}
297291
}
298292
};
299293
this.notification2 = showNotification(this.testNotif2);

0 commit comments

Comments
 (0)