1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08: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

@ -58,7 +58,11 @@ import {
getUnicodeRangeFor,
mapSpecialUnicodeValues,
} from "./unicode.js";
import { isSpace, MissingDataException, readUint32 } from "./core_utils.js";
import {
isWhiteSpace,
MissingDataException,
readUint32,
} from "./core_utils.js";
import { FontRendererFactory } from "./font_renderer.js";
import { IdentityCMap } from "./cmap.js";
import { Stream } from "./stream.js";
@ -3413,7 +3417,7 @@ var Type1Font = (function Type1FontClosure() {
if (j >= signatureLength) {
// `signature` found, skip over whitespace.
i += j;
while (i < streamBytesLength && isSpace(streamBytes[i])) {
while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) {
i++;
}
found = true;