1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38: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:
Jonas Jenwald 2020-02-10 09:38:57 +01:00
parent e4758beaaa
commit c5f67300e9
8 changed files with 32 additions and 28 deletions

View file

@ -16,7 +16,7 @@
import { FormatError, shadow } from "../shared/util.js";
import { EOF } from "./primitives.js";
import { isSpace } from "./core_utils.js";
import { isWhiteSpace } from "./core_utils.js";
class PostScriptParser {
constructor(lexer) {
@ -193,7 +193,7 @@ class PostScriptLexer {
}
} else if (ch === /* '%' = */ 0x25) {
comment = true;
} else if (!isSpace(ch)) {
} else if (!isWhiteSpace(ch)) {
break;
}
ch = this.nextChar();