1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #19504 from Snuffleupagus/eslint-fix-arrow-body-style

Fix all outstanding ESLint `arrow-body-style` warnings
This commit is contained in:
Jonas Jenwald 2025-02-18 17:52:36 +01:00 committed by GitHub
commit 426c730e11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 71 additions and 82 deletions

View file

@ -84,17 +84,14 @@ class AnnotationFactory {
// with "GoToE" actions, from throwing and thus breaking parsing:
pdfManager.ensureCatalog("attachments"),
]).then(
// eslint-disable-next-line arrow-body-style
([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => {
return {
pdfManager,
acroForm: acroForm instanceof Dict ? acroForm : Dict.empty,
xfaDatasets,
structTreeRoot,
baseUrl,
attachments,
};
},
([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => ({
pdfManager,
acroForm: acroForm instanceof Dict ? acroForm : Dict.empty,
xfaDatasets,
structTreeRoot,
baseUrl,
attachments,
}),
reason => {
warn(`createGlobals: "${reason}".`);
return null;

View file

@ -1620,24 +1620,24 @@ class PDFDocument {
} else {
promise = catalog.getPageDict(pageIndex);
}
// eslint-disable-next-line arrow-body-style
promise = promise.then(([pageDict, ref]) => {
return new Page({
pdfManager: this.pdfManager,
xref: this.xref,
pageIndex,
pageDict,
ref,
globalIdFactory: this._globalIdFactory,
fontCache: catalog.fontCache,
builtInCMapCache: catalog.builtInCMapCache,
standardFontDataCache: catalog.standardFontDataCache,
globalImageCache: catalog.globalImageCache,
systemFontCache: catalog.systemFontCache,
nonBlendModesSet: catalog.nonBlendModesSet,
xfaFactory,
});
});
promise = promise.then(
([pageDict, ref]) =>
new Page({
pdfManager: this.pdfManager,
xref: this.xref,
pageIndex,
pageDict,
ref,
globalIdFactory: this._globalIdFactory,
fontCache: catalog.fontCache,
builtInCMapCache: catalog.builtInCMapCache,
standardFontDataCache: catalog.standardFontDataCache,
globalImageCache: catalog.globalImageCache,
systemFontCache: catalog.systemFontCache,
nonBlendModesSet: catalog.nonBlendModesSet,
xfaFactory,
})
);
this._pagePromises.set(pageIndex, promise);
return promise;

View file

@ -1231,15 +1231,13 @@ class PartialEvaluator {
fallbackFontDict = null,
cssFontInfo = null
) {
// eslint-disable-next-line arrow-body-style
const errorFont = async () => {
return new TranslatedFont({
const errorFont = async () =>
new TranslatedFont({
loadedName: "g_font_error",
font: new ErrorFont(`Font "${fontName}" is not available.`),
dict: font,
evaluatorOptions: this.options,
});
};
let fontRef;
if (font) {