mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Use the ESLint no-restricted-syntax
rule to ensure that assert
is always called with two arguments
Having `assert` calls without a message string isn't very helpful when debugging, and it turns out that it's easy enough to make use of ESLint to enforce better `assert` call-sites. In a couple of cases the `assert` calls were changed to "regular" throwing of errors instead, since that seemed more appropriate. Please find additional details about the ESLint rule at https://eslint.org/docs/rules/no-restricted-syntax
This commit is contained in:
parent
491904d30a
commit
e1f340a0c2
14 changed files with 73 additions and 22 deletions
|
@ -516,7 +516,7 @@ function arrayByteLength(arr) {
|
|||
if (arr.length !== undefined) {
|
||||
return arr.length;
|
||||
}
|
||||
assert(arr.byteLength !== undefined);
|
||||
assert(arr.byteLength !== undefined, "arrayByteLength - invalid argument.");
|
||||
return arr.byteLength;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue