mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +02:00
Enable the unicorn/prefer-optional-catch-binding
ESLint plugin rule
According to MDN this format is available in all browsers/environments that we currently support, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch#browser_compatibility Please also see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
This commit is contained in:
parent
9af50dc358
commit
fee850737b
32 changed files with 45 additions and 44 deletions
|
@ -1057,7 +1057,7 @@ class PDFDocument {
|
|||
const str = stringToUTF8String(stream.getString());
|
||||
const data = { [key]: str };
|
||||
return shadow(this, "xfaDatasets", new DatasetReader(data));
|
||||
} catch (_) {
|
||||
} catch {
|
||||
warn("XFA - Invalid utf-8 string.");
|
||||
break;
|
||||
}
|
||||
|
@ -1077,7 +1077,7 @@ class PDFDocument {
|
|||
}
|
||||
try {
|
||||
data[key] = stringToUTF8String(stream.getString());
|
||||
} catch (_) {
|
||||
} catch {
|
||||
warn("XFA - Invalid utf-8 string.");
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue