Upstream the changes from: Bug 1339461 - Convert foo.indexOf(...) == -1 to foo.includes() and implement an eslint rule to enforce this

Yet another case where PDF.js code was modified in `mozilla-central` without the changes happening in the GitHub repo first; *sigh*.
If we don't upstream at least the changes in `extensions/firefox/`, any future update of PDF.js in `mozilla-central` will be blocked.

Please see:
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1339461
 - https://hg.mozilla.org/mozilla-central/rev/d5a5ad1dbbf2
This commit is contained in:
Jonas Jenwald 2018-02-04 14:50:58 +01:00
parent 9ac9ef8ef1
commit 712090eff8
9 changed files with 13 additions and 13 deletions

View file

@ -596,7 +596,7 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
optionElement.textContent = option.displayValue;
optionElement.value = option.exportValue;
if (this.data.fieldValue.indexOf(option.displayValue) >= 0) {
if (this.data.fieldValue.includes(option.displayValue)) {
optionElement.setAttribute('selected', true);
}
@ -628,7 +628,7 @@ class PopupAnnotationElement extends AnnotationElement {
this.container.className = 'popupAnnotation';
if (IGNORE_TYPES.indexOf(this.data.parentType) >= 0) {
if (IGNORE_TYPES.includes(this.data.parentType)) {
return this.container;
}