From 159402bf9004f84130d384eb116ec51b48d42391 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 22 Sep 2014 16:33:24 -0500 Subject: [PATCH] PDF.js version 1.0.680 --- bower.json | 2 +- build/pdf.combined.js | 47 ++++++++++++++++++++++--------------------- build/pdf.js | 4 ++-- build/pdf.worker.js | 47 ++++++++++++++++++++++--------------------- package.json | 2 +- 5 files changed, 52 insertions(+), 50 deletions(-) diff --git a/bower.json b/bower.json index 2a4850ac3..25ff85773 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.678", + "version": "1.0.680", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index bcf6ccf8e..c0509cc36 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.678'; -PDFJS.build = '9b480d7'; +PDFJS.version = '1.0.680'; +PDFJS.build = '992e761'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -35308,32 +35308,33 @@ var Parser = (function ParserClosure() { // searching for the /EI\s/ var state = 0, ch, i, ii; - while (state !== 4 && (ch = stream.getByte()) !== -1) { - switch (ch | 0) { - case 0x20: - case 0x0D: - case 0x0A: - // let's check next five bytes to be ASCII... just be sure - var followingBytes = stream.peekBytes(5); - for (i = 0, ii = followingBytes.length; i < ii; i++) { + var E = 0x45, I = 0x49, SPACE = 0x20, NL = 0xA, CR = 0xD; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = (ch === E) ? 1 : 0; + } else if (state === 1) { + state = (ch === I) ? 2 : 0; + } else { + assert(state === 2); + if (ch === SPACE || ch === NL || ch === CR) { + // Let's check the next five bytes are ASCII... just be sure. + var n = 5; + var followingBytes = stream.peekBytes(n); + for (i = 0; i < n; i++) { ch = followingBytes[i]; - if (ch !== 0x0A && ch !== 0x0D && (ch < 0x20 || ch > 0x7F)) { - // not a LF, CR, SPACE or any visible ASCII character + if (ch !== NL && ch !== CR && (ch < SPACE || ch > 0x7F)) { + // Not a LF, CR, SPACE or any visible ASCII character, i.e. + // it's binary stuff. Resetting the state. state = 0; - break; // some binary stuff found, resetting the state + break; } } - state = (state === 3 ? 4 : 0); - break; - case 0x45: - state = 2; - break; - case 0x49: - state = (state === 2 ? 3 : 0); - break; - default: + if (state === 2) { + break; // finished! + } + } else { state = 0; - break; + } } } diff --git a/build/pdf.js b/build/pdf.js index 42ef39a4b..b196658d0 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.678'; -PDFJS.build = '9b480d7'; +PDFJS.version = '1.0.680'; +PDFJS.build = '992e761'; (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 65cd48ec9..dcf62fe21 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.678'; -PDFJS.build = '9b480d7'; +PDFJS.version = '1.0.680'; +PDFJS.build = '992e761'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -29325,32 +29325,33 @@ var Parser = (function ParserClosure() { // searching for the /EI\s/ var state = 0, ch, i, ii; - while (state !== 4 && (ch = stream.getByte()) !== -1) { - switch (ch | 0) { - case 0x20: - case 0x0D: - case 0x0A: - // let's check next five bytes to be ASCII... just be sure - var followingBytes = stream.peekBytes(5); - for (i = 0, ii = followingBytes.length; i < ii; i++) { + var E = 0x45, I = 0x49, SPACE = 0x20, NL = 0xA, CR = 0xD; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = (ch === E) ? 1 : 0; + } else if (state === 1) { + state = (ch === I) ? 2 : 0; + } else { + assert(state === 2); + if (ch === SPACE || ch === NL || ch === CR) { + // Let's check the next five bytes are ASCII... just be sure. + var n = 5; + var followingBytes = stream.peekBytes(n); + for (i = 0; i < n; i++) { ch = followingBytes[i]; - if (ch !== 0x0A && ch !== 0x0D && (ch < 0x20 || ch > 0x7F)) { - // not a LF, CR, SPACE or any visible ASCII character + if (ch !== NL && ch !== CR && (ch < SPACE || ch > 0x7F)) { + // Not a LF, CR, SPACE or any visible ASCII character, i.e. + // it's binary stuff. Resetting the state. state = 0; - break; // some binary stuff found, resetting the state + break; } } - state = (state === 3 ? 4 : 0); - break; - case 0x45: - state = 2; - break; - case 0x49: - state = (state === 2 ? 3 : 0); - break; - default: + if (state === 2) { + break; // finished! + } + } else { state = 0; - break; + } } } diff --git a/package.json b/package.json index d127d824d..ca5479b66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.678", + "version": "1.0.680", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",