From a54dbab5af47f08c417fac36bb13445192e32ef0 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 22 Sep 2014 16:30:39 -0500 Subject: [PATCH] PDF.js version 1.0.569 --- bower.json | 2 +- build/pdf.combined.js | 82 +++++++++++++++++++++---------------------- build/pdf.js | 4 +-- build/pdf.worker.js | 82 +++++++++++++++++++++---------------------- package.json | 2 +- 5 files changed, 86 insertions(+), 86 deletions(-) diff --git a/bower.json b/bower.json index ac7c293ca..7ad4b6bc8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.566", + "version": "1.0.569", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 241378a03..6100c2d6e 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.566'; -PDFJS.build = 'cb59b57'; +PDFJS.version = '1.0.569'; +PDFJS.build = '10daf04'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -33547,7 +33547,7 @@ var Parser = (function ParserClosure() { // searching for the /EI\s/ var state = 0, ch, i, ii; - while (state != 4 && (ch = stream.getByte()) !== -1) { + while (state !== 4 && (ch = stream.getByte()) !== -1) { switch (ch | 0) { case 0x20: case 0x0D: @@ -33741,7 +33741,7 @@ var Parser = (function ParserClosure() { } try { var xrefStreamStats = this.xref.stats.streamTypes; - if (name == 'FlateDecode' || name == 'Fl') { + if (name === 'FlateDecode' || name === 'Fl') { xrefStreamStats[StreamType.FLATE] = true; if (params) { return new PredictorStream(new FlateStream(stream, maybeLength), @@ -33749,7 +33749,7 @@ var Parser = (function ParserClosure() { } return new FlateStream(stream, maybeLength); } - if (name == 'LZWDecode' || name == 'LZW') { + if (name === 'LZWDecode' || name === 'LZW') { xrefStreamStats[StreamType.LZW] = true; var earlyChange = 1; if (params) { @@ -33762,31 +33762,31 @@ var Parser = (function ParserClosure() { } return new LZWStream(stream, maybeLength, earlyChange); } - if (name == 'DCTDecode' || name == 'DCT') { + if (name === 'DCTDecode' || name === 'DCT') { xrefStreamStats[StreamType.DCT] = true; return new JpegStream(stream, maybeLength, stream.dict, this.xref); } - if (name == 'JPXDecode' || name == 'JPX') { + if (name === 'JPXDecode' || name === 'JPX') { xrefStreamStats[StreamType.JPX] = true; return new JpxStream(stream, maybeLength, stream.dict); } - if (name == 'ASCII85Decode' || name == 'A85') { + if (name === 'ASCII85Decode' || name === 'A85') { xrefStreamStats[StreamType.A85] = true; return new Ascii85Stream(stream, maybeLength); } - if (name == 'ASCIIHexDecode' || name == 'AHx') { + if (name === 'ASCIIHexDecode' || name === 'AHx') { xrefStreamStats[StreamType.AHX] = true; return new AsciiHexStream(stream, maybeLength); } - if (name == 'CCITTFaxDecode' || name == 'CCF') { + if (name === 'CCITTFaxDecode' || name === 'CCF') { xrefStreamStats[StreamType.CCF] = true; return new CCITTFaxStream(stream, maybeLength, params); } - if (name == 'RunLengthDecode' || name == 'RL') { + if (name === 'RunLengthDecode' || name === 'RL') { xrefStreamStats[StreamType.RL] = true; return new RunLengthStream(stream, maybeLength); } - if (name == 'JBIG2Decode') { + if (name === 'JBIG2Decode') { xrefStreamStats[StreamType.JBIG] = true; return new Jbig2Stream(stream, maybeLength, stream.dict); } @@ -34045,7 +34045,7 @@ var Lexer = (function LexerClosure() { if (ch === 0x23) { // '#' ch = this.nextChar(); var x = toHexDigit(ch); - if (x != -1) { + if (x !== -1) { var x2 = toHexDigit(this.nextChar()); if (x2 === -1) { error('Illegal digit in hex char in name: ' + x2); @@ -34827,10 +34827,10 @@ var FlateStream = (function FlateStreamClosure() { var cmf = str.getByte(); var flg = str.getByte(); - if (cmf == -1 || flg == -1) { + if (cmf === -1 || flg === -1) { error('Invalid header in flate stream: ' + cmf + ', ' + flg); } - if ((cmf & 0x0f) != 0x08) { + if ((cmf & 0x0f) !== 0x08) { error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); } if ((((cmf << 8) + flg) % 31) !== 0) { @@ -34897,7 +34897,7 @@ var FlateStream = (function FlateStreamClosure() { }; FlateStream.prototype.generateHuffmanTable = - function flateStreamGenerateHuffmanTable(lengths) { + function flateStreamGenerateHuffmanTable(lengths) { var n = lengths.length; // find max code length @@ -34916,7 +34916,7 @@ var FlateStream = (function FlateStreamClosure() { len <= maxLen; ++len, code <<= 1, skip <<= 1) { for (var val = 0; val < n; ++val) { - if (lengths[val] == len) { + if (lengths[val] === len) { // bit-reverse the code var code2 = 0; var t = code; @@ -34966,7 +34966,7 @@ var FlateStream = (function FlateStreamClosure() { error('Bad block header in flate stream'); } check |= (b << 8); - if (check != (~blockLen & 0xffff) && + if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { // Ignoring error for bad "empty" block (see issue 1277) error('Bad uncompressed block length in flate stream'); @@ -34997,10 +34997,10 @@ var FlateStream = (function FlateStreamClosure() { var litCodeTable; var distCodeTable; - if (hdr == 1) { // compressed block, fixed codes + if (hdr === 1) { // compressed block, fixed codes litCodeTable = fixedLitCodeTab; distCodeTable = fixedDistCodeTab; - } else if (hdr == 2) { // compressed block, dynamic codes + } else if (hdr === 2) { // compressed block, dynamic codes var numLitCodes = this.getBits(5) + 257; var numDistCodes = this.getBits(5) + 1; var numCodeLenCodes = this.getBits(4) + 4; @@ -35022,11 +35022,11 @@ var FlateStream = (function FlateStreamClosure() { var bitsLength, bitsOffset, what; while (i < codes) { var code = this.getCode(codeLenCodeTab); - if (code == 16) { + if (code === 16) { bitsLength = 2; bitsOffset = 3; what = len; - } else if (code == 17) { + } else if (code === 17) { bitsLength = 3; bitsOffset = 3; what = (len = 0); - } else if (code == 18) { + } else if (code === 18) { bitsLength = 7; bitsOffset = 11; what = (len = 0); } else { codeLengths[i++] = len = code; @@ -35060,7 +35060,7 @@ var FlateStream = (function FlateStreamClosure() { buffer[pos++] = code1; continue; } - if (code1 == 256) { + if (code1 === 256) { this.bufferLength = pos; return; } @@ -35381,7 +35381,7 @@ var JpegStream = (function JpegStreamClosure() { function JpegStream_isNativelyDecodable(xref, res) { var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); var numComps = cs.numComps; - return numComps == 1 || numComps == 3; + return numComps === 1 || numComps === 3; }; return JpegStream; @@ -35601,7 +35601,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() { var i; // special code for z - if (c == Z_LOWER_CHAR) { + if (c === Z_LOWER_CHAR) { buffer = this.ensureBuffer(bufferLength + 4); for (i = 0; i < 4; ++i) { buffer[bufferLength + i] = 0; @@ -35618,7 +35618,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() { input[i] = c; - if (c === EOF || c == TILDA_CHAR) { + if (c === EOF || c === TILDA_CHAR) { break; } } @@ -35725,7 +35725,7 @@ var RunLengthStream = (function RunLengthStreamClosure() { // (in addition to the second byte from the header), n = 129 through 255 - // duplicate the second byte from the header (257 - n) times, n = 128 - end. var repeatHeader = this.str.getBytes(2); - if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] == 128) { + if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { this.eof = true; return; } @@ -36218,7 +36218,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { while ((code1 = this.lookBits(12)) === 0) { this.eatBits(1); } - if (code1 == 1) { + if (code1 === 1) { this.eatBits(12); } if (this.encoding > 0) { @@ -36477,7 +36477,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var gotEOL = false; - if (!this.eoblock && this.row == this.rows - 1) { + if (!this.eoblock && this.row === this.rows - 1) { this.eof = true; } else { code1 = this.lookBits(12); @@ -36485,10 +36485,10 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { this.eatBits(1); code1 = this.lookBits(12); } - if (code1 == 1) { + if (code1 === 1) { this.eatBits(12); gotEOL = true; - } else if (code1 == EOF) { + } else if (code1 === EOF) { this.eof = true; } } @@ -36500,7 +36500,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { if (this.eoblock && gotEOL) { code1 = this.lookBits(12); - if (code1 == 1) { + if (code1 === 1) { this.eatBits(12); if (this.encoding > 0) { this.lookBits(1); @@ -36509,7 +36509,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { if (this.encoding >= 0) { for (i = 0; i < 4; ++i) { code1 = this.lookBits(12); - if (code1 != 1) { + if (code1 !== 1) { info('bad rtc code: ' + code1); } this.eatBits(12); @@ -36524,11 +36524,11 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { } else if (this.err && this.eoline) { while (true) { code1 = this.lookBits(13); - if (code1 == EOF) { + if (code1 === EOF) { this.eof = true; return null; } - if ((code1 >> 1) == 1) { + if ((code1 >> 1) === 1) { break; } this.eatBits(1); @@ -36604,7 +36604,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var limitValue = limit || 0; for (var i = start; i <= end; ++i) { var code = this.lookBits(i); - if (code == EOF) { + if (code === EOF) { return [true, 1, false]; } if (i < end) { @@ -36612,7 +36612,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { } if (!limitValue || code >= limitValue) { var p = table[code - limitValue]; - if (p[0] == i) { + if (p[0] === i) { this.eatBits(i); return [true, p[1], true]; } @@ -36650,7 +36650,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var p; if (this.eoblock) { code = this.lookBits(12); - if (code == EOF) { + if (code === EOF) { return 1; } @@ -36686,7 +36686,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var code, p; if (this.eoblock) { code = this.lookBits(13); - if (code == EOF) { + if (code === EOF) { return 1; } if ((code >> 7) === 0) { @@ -36834,7 +36834,7 @@ var LZWStream = (function LZWStreamClosure() { } else { currentSequence[currentSequenceLength++] = currentSequence[0]; } - } else if (code == 256) { + } else if (code === 256) { codeLength = 9; nextCode = 258; currentSequenceLength = 0; diff --git a/build/pdf.js b/build/pdf.js index f71524671..42d3bb6a3 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.566'; -PDFJS.build = 'cb59b57'; +PDFJS.version = '1.0.569'; +PDFJS.build = '10daf04'; (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 2df4bffa4..70b1e11b3 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.566'; -PDFJS.build = 'cb59b57'; +PDFJS.version = '1.0.569'; +PDFJS.build = '10daf04'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -28690,7 +28690,7 @@ var Parser = (function ParserClosure() { // searching for the /EI\s/ var state = 0, ch, i, ii; - while (state != 4 && (ch = stream.getByte()) !== -1) { + while (state !== 4 && (ch = stream.getByte()) !== -1) { switch (ch | 0) { case 0x20: case 0x0D: @@ -28884,7 +28884,7 @@ var Parser = (function ParserClosure() { } try { var xrefStreamStats = this.xref.stats.streamTypes; - if (name == 'FlateDecode' || name == 'Fl') { + if (name === 'FlateDecode' || name === 'Fl') { xrefStreamStats[StreamType.FLATE] = true; if (params) { return new PredictorStream(new FlateStream(stream, maybeLength), @@ -28892,7 +28892,7 @@ var Parser = (function ParserClosure() { } return new FlateStream(stream, maybeLength); } - if (name == 'LZWDecode' || name == 'LZW') { + if (name === 'LZWDecode' || name === 'LZW') { xrefStreamStats[StreamType.LZW] = true; var earlyChange = 1; if (params) { @@ -28905,31 +28905,31 @@ var Parser = (function ParserClosure() { } return new LZWStream(stream, maybeLength, earlyChange); } - if (name == 'DCTDecode' || name == 'DCT') { + if (name === 'DCTDecode' || name === 'DCT') { xrefStreamStats[StreamType.DCT] = true; return new JpegStream(stream, maybeLength, stream.dict, this.xref); } - if (name == 'JPXDecode' || name == 'JPX') { + if (name === 'JPXDecode' || name === 'JPX') { xrefStreamStats[StreamType.JPX] = true; return new JpxStream(stream, maybeLength, stream.dict); } - if (name == 'ASCII85Decode' || name == 'A85') { + if (name === 'ASCII85Decode' || name === 'A85') { xrefStreamStats[StreamType.A85] = true; return new Ascii85Stream(stream, maybeLength); } - if (name == 'ASCIIHexDecode' || name == 'AHx') { + if (name === 'ASCIIHexDecode' || name === 'AHx') { xrefStreamStats[StreamType.AHX] = true; return new AsciiHexStream(stream, maybeLength); } - if (name == 'CCITTFaxDecode' || name == 'CCF') { + if (name === 'CCITTFaxDecode' || name === 'CCF') { xrefStreamStats[StreamType.CCF] = true; return new CCITTFaxStream(stream, maybeLength, params); } - if (name == 'RunLengthDecode' || name == 'RL') { + if (name === 'RunLengthDecode' || name === 'RL') { xrefStreamStats[StreamType.RL] = true; return new RunLengthStream(stream, maybeLength); } - if (name == 'JBIG2Decode') { + if (name === 'JBIG2Decode') { xrefStreamStats[StreamType.JBIG] = true; return new Jbig2Stream(stream, maybeLength, stream.dict); } @@ -29188,7 +29188,7 @@ var Lexer = (function LexerClosure() { if (ch === 0x23) { // '#' ch = this.nextChar(); var x = toHexDigit(ch); - if (x != -1) { + if (x !== -1) { var x2 = toHexDigit(this.nextChar()); if (x2 === -1) { error('Illegal digit in hex char in name: ' + x2); @@ -29970,10 +29970,10 @@ var FlateStream = (function FlateStreamClosure() { var cmf = str.getByte(); var flg = str.getByte(); - if (cmf == -1 || flg == -1) { + if (cmf === -1 || flg === -1) { error('Invalid header in flate stream: ' + cmf + ', ' + flg); } - if ((cmf & 0x0f) != 0x08) { + if ((cmf & 0x0f) !== 0x08) { error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); } if ((((cmf << 8) + flg) % 31) !== 0) { @@ -30040,7 +30040,7 @@ var FlateStream = (function FlateStreamClosure() { }; FlateStream.prototype.generateHuffmanTable = - function flateStreamGenerateHuffmanTable(lengths) { + function flateStreamGenerateHuffmanTable(lengths) { var n = lengths.length; // find max code length @@ -30059,7 +30059,7 @@ var FlateStream = (function FlateStreamClosure() { len <= maxLen; ++len, code <<= 1, skip <<= 1) { for (var val = 0; val < n; ++val) { - if (lengths[val] == len) { + if (lengths[val] === len) { // bit-reverse the code var code2 = 0; var t = code; @@ -30109,7 +30109,7 @@ var FlateStream = (function FlateStreamClosure() { error('Bad block header in flate stream'); } check |= (b << 8); - if (check != (~blockLen & 0xffff) && + if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { // Ignoring error for bad "empty" block (see issue 1277) error('Bad uncompressed block length in flate stream'); @@ -30140,10 +30140,10 @@ var FlateStream = (function FlateStreamClosure() { var litCodeTable; var distCodeTable; - if (hdr == 1) { // compressed block, fixed codes + if (hdr === 1) { // compressed block, fixed codes litCodeTable = fixedLitCodeTab; distCodeTable = fixedDistCodeTab; - } else if (hdr == 2) { // compressed block, dynamic codes + } else if (hdr === 2) { // compressed block, dynamic codes var numLitCodes = this.getBits(5) + 257; var numDistCodes = this.getBits(5) + 1; var numCodeLenCodes = this.getBits(4) + 4; @@ -30165,11 +30165,11 @@ var FlateStream = (function FlateStreamClosure() { var bitsLength, bitsOffset, what; while (i < codes) { var code = this.getCode(codeLenCodeTab); - if (code == 16) { + if (code === 16) { bitsLength = 2; bitsOffset = 3; what = len; - } else if (code == 17) { + } else if (code === 17) { bitsLength = 3; bitsOffset = 3; what = (len = 0); - } else if (code == 18) { + } else if (code === 18) { bitsLength = 7; bitsOffset = 11; what = (len = 0); } else { codeLengths[i++] = len = code; @@ -30203,7 +30203,7 @@ var FlateStream = (function FlateStreamClosure() { buffer[pos++] = code1; continue; } - if (code1 == 256) { + if (code1 === 256) { this.bufferLength = pos; return; } @@ -30524,7 +30524,7 @@ var JpegStream = (function JpegStreamClosure() { function JpegStream_isNativelyDecodable(xref, res) { var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); var numComps = cs.numComps; - return numComps == 1 || numComps == 3; + return numComps === 1 || numComps === 3; }; return JpegStream; @@ -30744,7 +30744,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() { var i; // special code for z - if (c == Z_LOWER_CHAR) { + if (c === Z_LOWER_CHAR) { buffer = this.ensureBuffer(bufferLength + 4); for (i = 0; i < 4; ++i) { buffer[bufferLength + i] = 0; @@ -30761,7 +30761,7 @@ var Ascii85Stream = (function Ascii85StreamClosure() { input[i] = c; - if (c === EOF || c == TILDA_CHAR) { + if (c === EOF || c === TILDA_CHAR) { break; } } @@ -30868,7 +30868,7 @@ var RunLengthStream = (function RunLengthStreamClosure() { // (in addition to the second byte from the header), n = 129 through 255 - // duplicate the second byte from the header (257 - n) times, n = 128 - end. var repeatHeader = this.str.getBytes(2); - if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] == 128) { + if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { this.eof = true; return; } @@ -31361,7 +31361,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { while ((code1 = this.lookBits(12)) === 0) { this.eatBits(1); } - if (code1 == 1) { + if (code1 === 1) { this.eatBits(12); } if (this.encoding > 0) { @@ -31620,7 +31620,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var gotEOL = false; - if (!this.eoblock && this.row == this.rows - 1) { + if (!this.eoblock && this.row === this.rows - 1) { this.eof = true; } else { code1 = this.lookBits(12); @@ -31628,10 +31628,10 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { this.eatBits(1); code1 = this.lookBits(12); } - if (code1 == 1) { + if (code1 === 1) { this.eatBits(12); gotEOL = true; - } else if (code1 == EOF) { + } else if (code1 === EOF) { this.eof = true; } } @@ -31643,7 +31643,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { if (this.eoblock && gotEOL) { code1 = this.lookBits(12); - if (code1 == 1) { + if (code1 === 1) { this.eatBits(12); if (this.encoding > 0) { this.lookBits(1); @@ -31652,7 +31652,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { if (this.encoding >= 0) { for (i = 0; i < 4; ++i) { code1 = this.lookBits(12); - if (code1 != 1) { + if (code1 !== 1) { info('bad rtc code: ' + code1); } this.eatBits(12); @@ -31667,11 +31667,11 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { } else if (this.err && this.eoline) { while (true) { code1 = this.lookBits(13); - if (code1 == EOF) { + if (code1 === EOF) { this.eof = true; return null; } - if ((code1 >> 1) == 1) { + if ((code1 >> 1) === 1) { break; } this.eatBits(1); @@ -31747,7 +31747,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var limitValue = limit || 0; for (var i = start; i <= end; ++i) { var code = this.lookBits(i); - if (code == EOF) { + if (code === EOF) { return [true, 1, false]; } if (i < end) { @@ -31755,7 +31755,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { } if (!limitValue || code >= limitValue) { var p = table[code - limitValue]; - if (p[0] == i) { + if (p[0] === i) { this.eatBits(i); return [true, p[1], true]; } @@ -31793,7 +31793,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var p; if (this.eoblock) { code = this.lookBits(12); - if (code == EOF) { + if (code === EOF) { return 1; } @@ -31829,7 +31829,7 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() { var code, p; if (this.eoblock) { code = this.lookBits(13); - if (code == EOF) { + if (code === EOF) { return 1; } if ((code >> 7) === 0) { @@ -31977,7 +31977,7 @@ var LZWStream = (function LZWStreamClosure() { } else { currentSequence[currentSequenceLength++] = currentSequence[0]; } - } else if (code == 256) { + } else if (code === 256) { codeLength = 9; nextCode = 258; currentSequenceLength = 0; diff --git a/package.json b/package.json index 31589cf6f..5889367b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.566", + "version": "1.0.569", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",