1
0
Fork 0
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:
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

@ -21,7 +21,7 @@
import { FormatError, stringToBytes, unreachable } from "../shared/util.js";
import { isDict } from "./primitives.js";
import { isSpace } from "./core_utils.js";
import { isWhiteSpace } from "./core_utils.js";
var Stream = (function StreamClosure() {
function Stream(arrayBuffer, start, length, dict) {
@ -1001,7 +1001,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() {
var str = this.str;
var c = str.getByte();
while (isSpace(c)) {
while (isWhiteSpace(c)) {
c = str.getByte();
}
@ -1026,7 +1026,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() {
input[0] = c;
for (i = 1; i < 5; ++i) {
c = str.getByte();
while (isSpace(c)) {
while (isWhiteSpace(c)) {
c = str.getByte();
}