Bug 1435700 - Fix eslint .includes instead of .indexOf. r=MakeMyDay,jorgk
MozReview-Commit-ID: 5IlkJ45NT0R
This commit is contained in:
Родитель
ebea3d9577
Коммит
6b2ff35324
|
@ -3366,7 +3366,7 @@
|
|||
}
|
||||
setUpDayHeaderBox(dayHeaderBox, date);
|
||||
|
||||
if (this.mDaysOffArray.indexOf(date.weekday) >= 0) {
|
||||
if (this.mDaysOffArray.includes(date.weekday)) {
|
||||
dayEventsBox.dayOff = true;
|
||||
dayHeaderBox.setAttribute("weekend", "true");
|
||||
} else {
|
||||
|
|
|
@ -129,8 +129,9 @@ OAuth2.prototype = {
|
|||
},
|
||||
|
||||
_checkForRedirect: function(aURL) {
|
||||
if (aURL.indexOf(this._parent.completionURI) != 0)
|
||||
if (!aURL.startsWith(this._parent.completionURI)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._parent.finishAuthorizationRequest();
|
||||
this._parent.onAuthorizationReceived(aURL);
|
||||
|
|
|
@ -141,7 +141,7 @@ calStorageTimezone.prototype = {
|
|||
*/
|
||||
function getTimezone(aTimezone) {
|
||||
let timezone = null;
|
||||
if (aTimezone.indexOf("BEGIN:VTIMEZONE") == 0) {
|
||||
if (aTimezone.startsWith("BEGIN:VTIMEZONE")) {
|
||||
timezone = gForeignTimezonesCache[aTimezone]; // using full definition as key
|
||||
if (!timezone) {
|
||||
try {
|
||||
|
|
|
@ -199,8 +199,8 @@ function checkRoundtrip(expectedProps, obj) {
|
|||
icskey = "summary";
|
||||
break;
|
||||
}
|
||||
ok(icsdata.indexOf(icskey.toUpperCase()) > 0);
|
||||
ok(icsdata.indexOf(expectedProps[key]) > 0);
|
||||
ok(icsdata.includes(icskey.toUpperCase()));
|
||||
ok(icsdata.includes(expectedProps[key]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
throw new Error(`toolbar ID ${this.id}${tbName}: toolboxid attribute '${toolboxId}' points to a toolbox that doesn't exist`);
|
||||
}
|
||||
|
||||
if (toolbox.externalToolbars.indexOf(this) == -1)
|
||||
if (!toolbox.externalToolbars.includes(this))
|
||||
toolbox.externalToolbars.push(this);
|
||||
|
||||
return this._toolbox = toolbox;
|
||||
|
@ -404,9 +404,7 @@
|
|||
var defaultOrNoninteractive = (this.getAttribute("defaultset") || "")
|
||||
.split(",")
|
||||
.concat(["separator", "spacer", "spring"]);
|
||||
return aCurrentSet.split(",").some(function(item) {
|
||||
return defaultOrNoninteractive.indexOf(item) == -1;
|
||||
});
|
||||
return aCurrentSet.split(",").some(item => !defaultOrNoninteractive.includes(item));
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
|
Загрузка…
Ссылка в новой задаче