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:
commit
426c730e11
5 changed files with 71 additions and 82 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue