1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Make getOperatorList() calls independent and merge queues at end

This commit is contained in:
Mack Duan 2013-04-08 15:14:56 -07:00
parent 6b2c6fc223
commit dbccbaaa27
10 changed files with 1208 additions and 753 deletions

View file

@ -36,6 +36,21 @@ var Parser = (function ParserClosure() {
}
Parser.prototype = {
saveState: function Parser_saveState() {
this.state = {
buf1: this.buf1,
buf2: this.buf2,
streamPos: this.lexer.stream.pos
};
},
restoreState: function Parser_restoreState() {
var state = this.state;
this.buf1 = state.buf1;
this.buf2 = state.buf2;
this.lexer.stream.pos = state.streamPos;
},
refill: function Parser_refill() {
this.buf1 = this.lexer.getObj();
this.buf2 = this.lexer.getObj();