Bug 1436575 - Add exceptions for cases that cannot be simplified by negation or !! coercion. r=standard8

MozReview-Commit-ID: 8uiZAPq4N2h

--HG--
extra : rebase_source : 3ad599ec2af62769bd3440e42ac6e165eaae609d
This commit is contained in:
Jared Wein 2018-02-09 10:10:08 -05:00
Родитель 9788800512
Коммит 04a1ae5cee
5 изменённых файлов: 18 добавлений и 9 удалений

Просмотреть файл

@ -200,7 +200,8 @@ function setVCRangeInvoker(aDocAcc, aTextAccessible, aTextOffsets) {
*/
function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc,
aIsFromUserInput) {
var expectMove = !!aIdOrNameOrAcc;
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
var expectMove = aIdOrNameOrAcc != false;
this.invoke = function virtualCursorChangedInvoker_invoke() {
VCChangedChecker.
storePreviousPosAndOffset(aDocAcc.virtualCursor);
@ -260,7 +261,8 @@ function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc,
*/
function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets,
aIdOrNameOrAcc, aIsFromUserInput) {
var expectMove = !!aIdOrNameOrAcc;
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
var expectMove = aIdOrNameOrAcc != false;
this.invoke = function virtualCursorChangedInvoker_invoke() {
VCChangedChecker.storePreviousPosAndOffset(aDocAcc.virtualCursor);
SimpleTest.info(aDocAcc.virtualCursor.position);
@ -306,7 +308,8 @@ function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets,
*/
function moveVCCoordInvoker(aDocAcc, aX, aY, aIgnoreNoMatch,
aRule, aIdOrNameOrAcc) {
var expectMove = !!aIdOrNameOrAcc;
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
var expectMove = aIdOrNameOrAcc != false;
this.invoke = function virtualCursorChangedInvoker_invoke() {
VCChangedChecker.
storePreviousPosAndOffset(aDocAcc.virtualCursor);

Просмотреть файл

@ -499,12 +499,14 @@
if (!aBrowser)
aBrowser = this.mCurrentBrowser;
if (aCallGlobalListeners &&
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
if (aCallGlobalListeners != false &&
aBrowser == this.mCurrentBrowser) {
callListeners(this.mProgressListeners, aArguments);
}
if (aCallTabsListeners) {
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
if (aCallTabsListeners != false) {
aArguments.unshift(aBrowser);
callListeners(this.mTabsProgressListeners, aArguments);

Просмотреть файл

@ -139,7 +139,8 @@ function initializeAutoCompletion(ctx, options = {}) {
let cycle = reverse => {
if (popup && popup.isOpen) {
cycleSuggestions(ed, !!reverse);
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
cycleSuggestions(ed, reverse == true);
return null;
}

Просмотреть файл

@ -231,7 +231,8 @@
if (aTarget.hasAttribute("on" + aEventName)) {
var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
var rv = fn.call(aTarget, event);
if (!rv)
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
if (rv == false)
cancel = true;
}
return !cancel;
@ -486,7 +487,8 @@
if (aTarget.hasAttribute("on" + aEventName)) {
var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
var rv = fn.call(aTarget, event);
if (!rv)
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
if (rv == false)
cancel = true;
}
return !cancel;

Просмотреть файл

@ -420,7 +420,8 @@
if (handler != "") {
var fn = new Function("event", handler);
var returned = fn(event);
if (!returned)
// eslint-disable-next-line mozilla/no-compare-against-boolean-literals
if (returned == false)
noCancel = false;
}