]> git.parisson.com Git - pdf.js.git/commitdiff
Merge branch 'master' of github.com:andreasgal/pdf.js
authorsbarman <sbarman@L3CWZ5T.(none)>
Thu, 23 Jun 2011 15:05:00 +0000 (08:05 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Thu, 23 Jun 2011 15:05:00 +0000 (08:05 -0700)
1  2 
pdf.js

diff --cc pdf.js
index cd3cdfba5c3f91758a7c708149b8fe6e930bac1e,addcea6de46cebf4194167d90fa6822293072014..d940c4f8b123f131ff95e9931d286ea55d922793
--- 1/pdf.js
--- 2/pdf.js
+++ b/pdf.js
@@@ -220,46 -220,9 +220,46 @@@ var DecodeStream = (function() 
  })();
  
  
 +var FakeStream = (function() {
 +    function constructor(stream) {
 +        this.dict = stream.dict;
 +        DecodeStream.call(this);
 +    };
 +
 +    constructor.prototype = Object.create(DecodeStream.prototype);
 +    constructor.prototype.readBlock = function() {
 +        var bufferLength = this.bufferLength;
 +        bufferLength += 1024;
 +        var buffer = this.ensureBuffer(bufferLength);
 +        this.bufferLength = bufferLength;
 +    };
 +    constructor.prototype.getBytes = function(length) {
 +        var pos = this.pos;
 +
 +        if (length) {
 +            this.ensureBuffer(pos + length);
 +            var end = pos + length;
 +
 +            while (!this.eof && this.bufferLength < end)
 +                this.readBlock();
 +
 +            var bufEnd = this.bufferLength;
 +            if (end > bufEnd)
 +                end = bufEnd;
 +        } else {
 +            this.eof = true;
 +            var end = this.bufferLength;
 +        }
 +
 +        this.pos = end;
 +        return this.buffer.subarray(pos, end)
 +    };
 +
 +    return constructor;
 +})();
  
  var FlateStream = (function() {
-     const codeLenCodeMap = Uint32Array([
+     var codeLenCodeMap = new Uint32Array([
          16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
      ]);