1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38: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:
Jonas Jenwald 2016-06-06 09:11:33 +02:00
parent bd47440e79
commit a36a946976
7 changed files with 29 additions and 34 deletions

View file

@ -28,8 +28,8 @@
}(this, function (exports, sharedUtil, coreParser) {
var error = sharedUtil.error;
var isSpace = sharedUtil.isSpace;
var EOF = coreParser.EOF;
var Lexer = coreParser.Lexer;
var PostScriptParser = (function PostScriptParserClosure() {
function PostScriptParser(lexer) {
@ -173,7 +173,7 @@ var PostScriptLexer = (function PostScriptLexerClosure() {
}
} else if (ch === 0x25) { // '%'
comment = true;
} else if (!Lexer.isSpace(ch)) {
} else if (!isSpace(ch)) {
break;
}
ch = this.nextChar();