From f0d29d3d9cfae4ed2fca4b030f3a1fe770c76c53 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 22 Sep 2014 16:29:00 -0500 Subject: [PATCH] PDF.js version 1.0.450 --- bower.json | 2 +- build/pdf.combined.js | 32 ++++++++++++-------------------- build/pdf.js | 4 ++-- build/pdf.worker.js | 32 ++++++++++++-------------------- package.json | 2 +- 5 files changed, 28 insertions(+), 44 deletions(-) diff --git a/bower.json b/bower.json index 415330065..326e5f79c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.448", + "version": "1.0.450", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 8f4e052cf..99071760c 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.448'; -PDFJS.build = 'b5e5de0'; +PDFJS.version = '1.0.450'; +PDFJS.build = '0237d50'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -41441,11 +41441,17 @@ var StringStream = (function StringStreamClosure() { // super class for the decoding streams var DecodeStream = (function DecodeStreamClosure() { + // Lots of DecodeStreams are created whose buffers are never used. For these + // we share a single empty buffer. This is (a) space-efficient and (b) avoids + // having special cases that would be required if we used |null| for an empty + // buffer. + var emptyBuffer = new Uint8Array(0); + function DecodeStream(maybeMinBufferLength) { this.pos = 0; this.bufferLength = 0; this.eof = false; - this.buffer = null; + this.buffer = emptyBuffer; this.minBufferLength = 512; if (maybeMinBufferLength) { // Compute the first power of two that is as big as maybeMinBufferLength. @@ -41464,23 +41470,15 @@ var DecodeStream = (function DecodeStreamClosure() { }, ensureBuffer: function DecodeStream_ensureBuffer(requested) { var buffer = this.buffer; - var current; - if (buffer) { - current = buffer.byteLength; - if (requested <= current) { - return buffer; - } - } else { - current = 0; + if (requested <= buffer.byteLength) { + return buffer; } var size = this.minBufferLength; while (size < requested) { size *= 2; } var buffer2 = new Uint8Array(size); - if (buffer) { - buffer2.set(buffer); - } + buffer2.set(buffer); return (this.buffer = buffer2); }, getByte: function DecodeStream_getByte() { @@ -41524,12 +41522,6 @@ var DecodeStream = (function DecodeStreamClosure() { this.readBlock(); } end = this.bufferLength; - - // checking if bufferLength is still 0 then - // the buffer has to be initialized - if (!end) { - this.buffer = new Uint8Array(0); - } } this.pos = end; diff --git a/build/pdf.js b/build/pdf.js index c554b152c..9e84616a7 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.448'; -PDFJS.build = 'b5e5de0'; +PDFJS.version = '1.0.450'; +PDFJS.build = '0237d50'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index bee226182..935040997 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.448'; -PDFJS.build = 'b5e5de0'; +PDFJS.version = '1.0.450'; +PDFJS.build = '0237d50'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -36595,11 +36595,17 @@ var StringStream = (function StringStreamClosure() { // super class for the decoding streams var DecodeStream = (function DecodeStreamClosure() { + // Lots of DecodeStreams are created whose buffers are never used. For these + // we share a single empty buffer. This is (a) space-efficient and (b) avoids + // having special cases that would be required if we used |null| for an empty + // buffer. + var emptyBuffer = new Uint8Array(0); + function DecodeStream(maybeMinBufferLength) { this.pos = 0; this.bufferLength = 0; this.eof = false; - this.buffer = null; + this.buffer = emptyBuffer; this.minBufferLength = 512; if (maybeMinBufferLength) { // Compute the first power of two that is as big as maybeMinBufferLength. @@ -36618,23 +36624,15 @@ var DecodeStream = (function DecodeStreamClosure() { }, ensureBuffer: function DecodeStream_ensureBuffer(requested) { var buffer = this.buffer; - var current; - if (buffer) { - current = buffer.byteLength; - if (requested <= current) { - return buffer; - } - } else { - current = 0; + if (requested <= buffer.byteLength) { + return buffer; } var size = this.minBufferLength; while (size < requested) { size *= 2; } var buffer2 = new Uint8Array(size); - if (buffer) { - buffer2.set(buffer); - } + buffer2.set(buffer); return (this.buffer = buffer2); }, getByte: function DecodeStream_getByte() { @@ -36678,12 +36676,6 @@ var DecodeStream = (function DecodeStreamClosure() { this.readBlock(); } end = this.bufferLength; - - // checking if bufferLength is still 0 then - // the buffer has to be initialized - if (!end) { - this.buffer = new Uint8Array(0); - } } this.pos = end; diff --git a/package.json b/package.json index 0bf4817e4..8f04bba0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.448", + "version": "1.0.450", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",