mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Move the isSpace
utility function from core/parser.js to shared/util.js
Currently the `isSpace` utility function is a member of `Lexer`, which seems suboptimal, given that it's placed in `core/parser.js`. In practice, this means that in a number of `core/*.js` files we thus have an *otherwise* completely unnecessary dependency on `core/parser.js` for a one-line function. Instead, this patch moves `isSpace` into `shared/util.js` which seems more appropriate for this kind of utility function. Not to mention that since all the affected `core/*.js` files already depends on `shared/util.js`, this doesn't incur any more file dependencies.
This commit is contained in:
parent
bd47440e79
commit
a36a946976
7 changed files with 29 additions and 34 deletions
|
@ -38,6 +38,7 @@ var isArray = sharedUtil.isArray;
|
|||
var createObjectURL = sharedUtil.createObjectURL;
|
||||
var shadow = sharedUtil.shadow;
|
||||
var warn = sharedUtil.warn;
|
||||
var isSpace = sharedUtil.isSpace;
|
||||
var Dict = corePrimitives.Dict;
|
||||
var isDict = corePrimitives.isDict;
|
||||
var Jbig2Image = coreJbig2.Jbig2Image;
|
||||
|
@ -1146,11 +1147,6 @@ var DecryptStream = (function DecryptStreamClosure() {
|
|||
})();
|
||||
|
||||
var Ascii85Stream = (function Ascii85StreamClosure() {
|
||||
// Checks if ch is one of the following characters: SPACE, TAB, CR or LF.
|
||||
function isSpace(ch) {
|
||||
return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A);
|
||||
}
|
||||
|
||||
function Ascii85Stream(str, maybeLength) {
|
||||
this.str = str;
|
||||
this.dict = str.dict;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue