mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Rename the isSpace
helper function to isWhiteSpace
Trying to enable the ESLint rule `no-shadow`, against the `master` branch, would result in a fair number of errors in the `Glyph` class in `src/core/fonts.js`. Since the glyphs are exposed through the API, we can't very well change the `isSpace` property on `Glyph` instances. Thus the best approach seems, at least to me, to simply rename the `isSpace` helper function to `isWhiteSpace` which shouldn't cause any issues given that it's only used in the `src/core/` folder.
This commit is contained in:
parent
e4758beaaa
commit
c5f67300e9
8 changed files with 32 additions and 28 deletions
|
@ -42,7 +42,7 @@ import {
|
|||
} from "./primitives.js";
|
||||
import {
|
||||
getInheritableProperty,
|
||||
isSpace,
|
||||
isWhiteSpace,
|
||||
MissingDataException,
|
||||
XRefEntryException,
|
||||
XRefParseException,
|
||||
|
@ -598,7 +598,7 @@ class PDFDocument {
|
|||
let ch;
|
||||
do {
|
||||
ch = stream.getByte();
|
||||
} while (isSpace(ch));
|
||||
} while (isWhiteSpace(ch));
|
||||
let str = "";
|
||||
while (ch >= /* Space = */ 0x20 && ch <= /* '9' = */ 0x39) {
|
||||
str += String.fromCharCode(ch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue