mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Move EOF
/isEOF
from core/parser.js to core/primitives.js
Given the nature of `EOF` and `isEOF`, it seems to me that they really ought to be placed in `core/primitives.js` instead. In general, it doesn't seem great to have to depend on the entire `core/parser.js` file for such simple primitives/helper functions. In particular, while `core/ps_parser.js` is completely separate from `core/parser.js` with regards to its function, it still depends on the latter for just *one* primitive. Note that compared to e.g. PR 7389, this will not reduce the number of dependencies for `core/ps_parser`, however the new dependency IMHO makes more sense.
This commit is contained in:
parent
e132fa976e
commit
50c2856097
5 changed files with 17 additions and 15 deletions
|
@ -28,6 +28,8 @@
|
|||
|
||||
var isArray = sharedUtil.isArray;
|
||||
|
||||
var EOF = {};
|
||||
|
||||
var Name = (function NameClosure() {
|
||||
function Name(name) {
|
||||
this.name = name;
|
||||
|
@ -268,6 +270,10 @@ var RefSetCache = (function RefSetCacheClosure() {
|
|||
return RefSetCache;
|
||||
})();
|
||||
|
||||
function isEOF(v) {
|
||||
return (v === EOF);
|
||||
}
|
||||
|
||||
function isName(v, name) {
|
||||
return v instanceof Name && (name === undefined || v.name === name);
|
||||
}
|
||||
|
@ -293,12 +299,14 @@ function isStream(v) {
|
|||
return typeof v === 'object' && v !== null && v.getBytes !== undefined;
|
||||
}
|
||||
|
||||
exports.EOF = EOF;
|
||||
exports.Cmd = Cmd;
|
||||
exports.Dict = Dict;
|
||||
exports.Name = Name;
|
||||
exports.Ref = Ref;
|
||||
exports.RefSet = RefSet;
|
||||
exports.RefSetCache = RefSetCache;
|
||||
exports.isEOF = isEOF;
|
||||
exports.isCmd = isCmd;
|
||||
exports.isDict = isDict;
|
||||
exports.isName = isName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue