Browse Source

PDF.js version 1.6.467 - See mozilla/pdf.js@54d55e8b7ae8a49be6673a327a7168827bd963d1

master v1.6.467
Pdf Bot 8 years ago
parent
commit
38e19582c3
  1. 2
      bower.json
  2. 84
      build/pdf.combined.js
  3. 84
      build/pdf.js
  4. 2
      build/pdf.min.js
  5. 84
      build/pdf.worker.js
  6. 2
      build/pdf.worker.min.js
  7. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.6.465", "version": "1.6.467",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

84
build/pdf.combined.js

@ -23,8 +23,8 @@
} }
}(this, function (exports) { }(this, function (exports) {
'use strict'; 'use strict';
var pdfjsVersion = '1.6.465'; var pdfjsVersion = '1.6.467';
var pdfjsBuild = 'f8e793f'; var pdfjsBuild = '54d55e8';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -4363,7 +4363,7 @@
this._isInvalid = true; this._isInvalid = true;
} }
function IDNAToASCII(h) { function IDNAToASCII(h) {
if ('' === h) { if (h === '') {
invalid.call(this); invalid.call(this);
} }
return h.toLowerCase(); return h.toLowerCase();
@ -4421,7 +4421,7 @@
case 'scheme': case 'scheme':
if (c && ALPHANUMERIC.test(c)) { if (c && ALPHANUMERIC.test(c)) {
buffer += c.toLowerCase(); buffer += c.toLowerCase();
} else if (':' === c) { } else if (c === ':') {
this._scheme = buffer; this._scheme = buffer;
buffer = ''; buffer = '';
if (stateOverride) { if (stateOverride) {
@ -4430,7 +4430,7 @@
if (isRelativeScheme(this._scheme)) { if (isRelativeScheme(this._scheme)) {
this._isRelative = true; this._isRelative = true;
} }
if ('file' === this._scheme) { if (this._scheme === 'file') {
state = 'relative'; state = 'relative';
} else if (this._isRelative && base && base._scheme === this._scheme) { } else if (this._isRelative && base && base._scheme === this._scheme) {
state = 'relative or authority'; state = 'relative or authority';
@ -4452,10 +4452,10 @@
} }
break; break;
case 'scheme data': case 'scheme data':
if ('?' === c) { if (c === '?') {
this._query = '?'; this._query = '?';
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} else { } else {
@ -4474,7 +4474,7 @@
} }
break; break;
case 'relative or authority': case 'relative or authority':
if ('/' === c && '/' === input[cursor + 1]) { if (c === '/' && input[cursor + 1] === '/') {
state = 'authority ignore slashes'; state = 'authority ignore slashes';
} else { } else {
err('Expected /, got: ' + c); err('Expected /, got: ' + c);
@ -4495,12 +4495,12 @@
this._username = base._username; this._username = base._username;
this._password = base._password; this._password = base._password;
break loop; break loop;
} else if ('/' === c || '\\' === c) { } else if (c === '/' || c === '\\') {
if ('\\' === c) { if (c === '\\') {
err('\\ is an invalid code point.'); err('\\ is an invalid code point.');
} }
state = 'relative slash'; state = 'relative slash';
} else if ('?' === c) { } else if (c === '?') {
this._host = base._host; this._host = base._host;
this._port = base._port; this._port = base._port;
this._path = base._path.slice(); this._path = base._path.slice();
@ -4508,7 +4508,7 @@
this._username = base._username; this._username = base._username;
this._password = base._password; this._password = base._password;
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._host = base._host; this._host = base._host;
this._port = base._port; this._port = base._port;
this._path = base._path.slice(); this._path = base._path.slice();
@ -4533,11 +4533,11 @@
} }
break; break;
case 'relative slash': case 'relative slash':
if ('/' === c || '\\' === c) { if (c === '/' || c === '\\') {
if ('\\' === c) { if (c === '\\') {
err('\\ is an invalid code point.'); err('\\ is an invalid code point.');
} }
if ('file' === this._scheme) { if (this._scheme === 'file') {
state = 'file host'; state = 'file host';
} else { } else {
state = 'authority ignore slashes'; state = 'authority ignore slashes';
@ -4554,7 +4554,7 @@
} }
break; break;
case 'authority first slash': case 'authority first slash':
if ('/' === c) { if (c === '/') {
state = 'authority second slash'; state = 'authority second slash';
} else { } else {
err('Expected \'/\', got: ' + c); err('Expected \'/\', got: ' + c);
@ -4578,7 +4578,7 @@
} }
break; break;
case 'authority': case 'authority':
if ('@' === c) { if (c === '@') {
if (seenAt) { if (seenAt) {
err('@ already seen.'); err('@ already seen.');
buffer += '%40'; buffer += '%40';
@ -4586,11 +4586,11 @@
seenAt = true; seenAt = true;
for (var i = 0; i < buffer.length; i++) { for (var i = 0; i < buffer.length; i++) {
var cp = buffer[i]; var cp = buffer[i];
if ('\t' === cp || '\n' === cp || '\r' === cp) { if (cp === '\t' || cp === '\n' || cp === '\r') {
err('Invalid whitespace in authority.'); err('Invalid whitespace in authority.');
continue; continue;
} }
if (':' === cp && null === this._password) { if (cp === ':' && this._password === null) {
this._password = ''; this._password = '';
continue; continue;
} }
@ -4602,7 +4602,7 @@
} }
} }
buffer = ''; buffer = '';
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
cursor -= buffer.length; cursor -= buffer.length;
buffer = ''; buffer = '';
state = 'host'; state = 'host';
@ -4612,7 +4612,7 @@
} }
break; break;
case 'file host': case 'file host':
if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) {
state = 'relative path'; state = 'relative path';
} else if (buffer.length === 0) { } else if (buffer.length === 0) {
@ -4623,7 +4623,7 @@
state = 'relative path start'; state = 'relative path start';
} }
continue; continue;
} else if ('\t' === c || '\n' === c || '\r' === c) { } else if (c === '\t' || c === '\n' || c === '\r') {
err('Invalid whitespace in file host.'); err('Invalid whitespace in file host.');
} else { } else {
buffer += c; buffer += c;
@ -4631,14 +4631,14 @@
break; break;
case 'host': case 'host':
case 'hostname': case 'hostname':
if (':' === c && !seenBracket) { if (c === ':' && !seenBracket) {
this._host = IDNAToASCII.call(this, buffer); this._host = IDNAToASCII.call(this, buffer);
buffer = ''; buffer = '';
state = 'port'; state = 'port';
if ('hostname' === stateOverride) { if (stateOverride === 'hostname') {
break loop; break loop;
} }
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
this._host = IDNAToASCII.call(this, buffer); this._host = IDNAToASCII.call(this, buffer);
buffer = ''; buffer = '';
state = 'relative path start'; state = 'relative path start';
@ -4647,9 +4647,9 @@
} }
continue; continue;
} else if ('\t' !== c && '\n' !== c && '\r' !== c) { } else if ('\t' !== c && '\n' !== c && '\r' !== c) {
if ('[' === c) { if (c === '[') {
seenBracket = true; seenBracket = true;
} else if (']' === c) { } else if (c === ']') {
seenBracket = false; seenBracket = false;
} }
buffer += c; buffer += c;
@ -4660,7 +4660,7 @@
case 'port': case 'port':
if (/[0-9]/.test(c)) { if (/[0-9]/.test(c)) {
buffer += c; buffer += c;
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c || stateOverride) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) {
if ('' !== buffer) { if ('' !== buffer) {
var temp = parseInt(buffer, 10); var temp = parseInt(buffer, 10);
if (temp !== relative[this._scheme]) { if (temp !== relative[this._scheme]) {
@ -4673,14 +4673,14 @@
} }
state = 'relative path start'; state = 'relative path start';
continue; continue;
} else if ('\t' === c || '\n' === c || '\r' === c) { } else if (c === '\t' || c === '\n' || c === '\r') {
err('Invalid code point in port: ' + c); err('Invalid code point in port: ' + c);
} else { } else {
invalid.call(this); invalid.call(this);
} }
break; break;
case 'relative path start': case 'relative path start':
if ('\\' === c) { if (c === '\\') {
err('\'\\\' not allowed in path.'); err('\'\\\' not allowed in path.');
} }
state = 'relative path'; state = 'relative path';
@ -4689,32 +4689,32 @@
} }
break; break;
case 'relative path': case 'relative path':
if (EOF === c || '/' === c || '\\' === c || !stateOverride && ('?' === c || '#' === c)) { if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) {
if ('\\' === c) { if (c === '\\') {
err('\\ not allowed in relative path.'); err('\\ not allowed in relative path.');
} }
var tmp; var tmp;
if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
buffer = tmp; buffer = tmp;
} }
if ('..' === buffer) { if (buffer === '..') {
this._path.pop(); this._path.pop();
if ('/' !== c && '\\' !== c) { if ('/' !== c && '\\' !== c) {
this._path.push(''); this._path.push('');
} }
} else if ('.' === buffer && '/' !== c && '\\' !== c) { } else if (buffer === '.' && '/' !== c && '\\' !== c) {
this._path.push(''); this._path.push('');
} else if ('.' !== buffer) { } else if ('.' !== buffer) {
if ('file' === this._scheme && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') {
buffer = buffer[0] + ':'; buffer = buffer[0] + ':';
} }
this._path.push(buffer); this._path.push(buffer);
} }
buffer = ''; buffer = '';
if ('?' === c) { if (c === '?') {
this._query = '?'; this._query = '?';
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} }
@ -4723,7 +4723,7 @@
} }
break; break;
case 'query': case 'query':
if (!stateOverride && '#' === c) { if (!stateOverride && c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { } else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) {
@ -4827,27 +4827,27 @@
parse.call(this, pathname, 'relative path start'); parse.call(this, pathname, 'relative path start');
}, },
get search() { get search() {
return this._isInvalid || !this._query || '?' === this._query ? '' : this._query; return this._isInvalid || !this._query || this._query === '?' ? '' : this._query;
}, },
set search(search) { set search(search) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
this._query = '?'; this._query = '?';
if ('?' === search[0]) { if (search[0] === '?') {
search = search.slice(1); search = search.slice(1);
} }
parse.call(this, search, 'query'); parse.call(this, search, 'query');
}, },
get hash() { get hash() {
return this._isInvalid || !this._fragment || '#' === this._fragment ? '' : this._fragment; return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment;
}, },
set hash(hash) { set hash(hash) {
if (this._isInvalid) { if (this._isInvalid) {
return; return;
} }
this._fragment = '#'; this._fragment = '#';
if ('#' === hash[0]) { if (hash[0] === '#') {
hash = hash.slice(1); hash = hash.slice(1);
} }
parse.call(this, hash, 'fragment'); parse.call(this, hash, 'fragment');

84
build/pdf.js

@ -23,8 +23,8 @@
} }
}(this, function (exports) { }(this, function (exports) {
'use strict'; 'use strict';
var pdfjsVersion = '1.6.465'; var pdfjsVersion = '1.6.467';
var pdfjsBuild = 'f8e793f'; var pdfjsBuild = '54d55e8';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -1663,7 +1663,7 @@
this._isInvalid = true; this._isInvalid = true;
} }
function IDNAToASCII(h) { function IDNAToASCII(h) {
if ('' === h) { if (h === '') {
invalid.call(this); invalid.call(this);
} }
return h.toLowerCase(); return h.toLowerCase();
@ -1721,7 +1721,7 @@
case 'scheme': case 'scheme':
if (c && ALPHANUMERIC.test(c)) { if (c && ALPHANUMERIC.test(c)) {
buffer += c.toLowerCase(); buffer += c.toLowerCase();
} else if (':' === c) { } else if (c === ':') {
this._scheme = buffer; this._scheme = buffer;
buffer = ''; buffer = '';
if (stateOverride) { if (stateOverride) {
@ -1730,7 +1730,7 @@
if (isRelativeScheme(this._scheme)) { if (isRelativeScheme(this._scheme)) {
this._isRelative = true; this._isRelative = true;
} }
if ('file' === this._scheme) { if (this._scheme === 'file') {
state = 'relative'; state = 'relative';
} else if (this._isRelative && base && base._scheme === this._scheme) { } else if (this._isRelative && base && base._scheme === this._scheme) {
state = 'relative or authority'; state = 'relative or authority';
@ -1752,10 +1752,10 @@
} }
break; break;
case 'scheme data': case 'scheme data':
if ('?' === c) { if (c === '?') {
this._query = '?'; this._query = '?';
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} else { } else {
@ -1774,7 +1774,7 @@
} }
break; break;
case 'relative or authority': case 'relative or authority':
if ('/' === c && '/' === input[cursor + 1]) { if (c === '/' && input[cursor + 1] === '/') {
state = 'authority ignore slashes'; state = 'authority ignore slashes';
} else { } else {
err('Expected /, got: ' + c); err('Expected /, got: ' + c);
@ -1795,12 +1795,12 @@
this._username = base._username; this._username = base._username;
this._password = base._password; this._password = base._password;
break loop; break loop;
} else if ('/' === c || '\\' === c) { } else if (c === '/' || c === '\\') {
if ('\\' === c) { if (c === '\\') {
err('\\ is an invalid code point.'); err('\\ is an invalid code point.');
} }
state = 'relative slash'; state = 'relative slash';
} else if ('?' === c) { } else if (c === '?') {
this._host = base._host; this._host = base._host;
this._port = base._port; this._port = base._port;
this._path = base._path.slice(); this._path = base._path.slice();
@ -1808,7 +1808,7 @@
this._username = base._username; this._username = base._username;
this._password = base._password; this._password = base._password;
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._host = base._host; this._host = base._host;
this._port = base._port; this._port = base._port;
this._path = base._path.slice(); this._path = base._path.slice();
@ -1833,11 +1833,11 @@
} }
break; break;
case 'relative slash': case 'relative slash':
if ('/' === c || '\\' === c) { if (c === '/' || c === '\\') {
if ('\\' === c) { if (c === '\\') {
err('\\ is an invalid code point.'); err('\\ is an invalid code point.');
} }
if ('file' === this._scheme) { if (this._scheme === 'file') {
state = 'file host'; state = 'file host';
} else { } else {
state = 'authority ignore slashes'; state = 'authority ignore slashes';
@ -1854,7 +1854,7 @@
} }
break; break;
case 'authority first slash': case 'authority first slash':
if ('/' === c) { if (c === '/') {
state = 'authority second slash'; state = 'authority second slash';
} else { } else {
err('Expected \'/\', got: ' + c); err('Expected \'/\', got: ' + c);
@ -1878,7 +1878,7 @@
} }
break; break;
case 'authority': case 'authority':
if ('@' === c) { if (c === '@') {
if (seenAt) { if (seenAt) {
err('@ already seen.'); err('@ already seen.');
buffer += '%40'; buffer += '%40';
@ -1886,11 +1886,11 @@
seenAt = true; seenAt = true;
for (var i = 0; i < buffer.length; i++) { for (var i = 0; i < buffer.length; i++) {
var cp = buffer[i]; var cp = buffer[i];
if ('\t' === cp || '\n' === cp || '\r' === cp) { if (cp === '\t' || cp === '\n' || cp === '\r') {
err('Invalid whitespace in authority.'); err('Invalid whitespace in authority.');
continue; continue;
} }
if (':' === cp && null === this._password) { if (cp === ':' && this._password === null) {
this._password = ''; this._password = '';
continue; continue;
} }
@ -1902,7 +1902,7 @@
} }
} }
buffer = ''; buffer = '';
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
cursor -= buffer.length; cursor -= buffer.length;
buffer = ''; buffer = '';
state = 'host'; state = 'host';
@ -1912,7 +1912,7 @@
} }
break; break;
case 'file host': case 'file host':
if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) {
state = 'relative path'; state = 'relative path';
} else if (buffer.length === 0) { } else if (buffer.length === 0) {
@ -1923,7 +1923,7 @@
state = 'relative path start'; state = 'relative path start';
} }
continue; continue;
} else if ('\t' === c || '\n' === c || '\r' === c) { } else if (c === '\t' || c === '\n' || c === '\r') {
err('Invalid whitespace in file host.'); err('Invalid whitespace in file host.');
} else { } else {
buffer += c; buffer += c;
@ -1931,14 +1931,14 @@
break; break;
case 'host': case 'host':
case 'hostname': case 'hostname':
if (':' === c && !seenBracket) { if (c === ':' && !seenBracket) {
this._host = IDNAToASCII.call(this, buffer); this._host = IDNAToASCII.call(this, buffer);
buffer = ''; buffer = '';
state = 'port'; state = 'port';
if ('hostname' === stateOverride) { if (stateOverride === 'hostname') {
break loop; break loop;
} }
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
this._host = IDNAToASCII.call(this, buffer); this._host = IDNAToASCII.call(this, buffer);
buffer = ''; buffer = '';
state = 'relative path start'; state = 'relative path start';
@ -1947,9 +1947,9 @@
} }
continue; continue;
} else if ('\t' !== c && '\n' !== c && '\r' !== c) { } else if ('\t' !== c && '\n' !== c && '\r' !== c) {
if ('[' === c) { if (c === '[') {
seenBracket = true; seenBracket = true;
} else if (']' === c) { } else if (c === ']') {
seenBracket = false; seenBracket = false;
} }
buffer += c; buffer += c;
@ -1960,7 +1960,7 @@
case 'port': case 'port':
if (/[0-9]/.test(c)) { if (/[0-9]/.test(c)) {
buffer += c; buffer += c;
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c || stateOverride) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) {
if ('' !== buffer) { if ('' !== buffer) {
var temp = parseInt(buffer, 10); var temp = parseInt(buffer, 10);
if (temp !== relative[this._scheme]) { if (temp !== relative[this._scheme]) {
@ -1973,14 +1973,14 @@
} }
state = 'relative path start'; state = 'relative path start';
continue; continue;
} else if ('\t' === c || '\n' === c || '\r' === c) { } else if (c === '\t' || c === '\n' || c === '\r') {
err('Invalid code point in port: ' + c); err('Invalid code point in port: ' + c);
} else { } else {
invalid.call(this); invalid.call(this);
} }
break; break;
case 'relative path start': case 'relative path start':
if ('\\' === c) { if (c === '\\') {
err('\'\\\' not allowed in path.'); err('\'\\\' not allowed in path.');
} }
state = 'relative path'; state = 'relative path';
@ -1989,32 +1989,32 @@
} }
break; break;
case 'relative path': case 'relative path':
if (EOF === c || '/' === c || '\\' === c || !stateOverride && ('?' === c || '#' === c)) { if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) {
if ('\\' === c) { if (c === '\\') {
err('\\ not allowed in relative path.'); err('\\ not allowed in relative path.');
} }
var tmp; var tmp;
if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
buffer = tmp; buffer = tmp;
} }
if ('..' === buffer) { if (buffer === '..') {
this._path.pop(); this._path.pop();
if ('/' !== c && '\\' !== c) { if ('/' !== c && '\\' !== c) {
this._path.push(''); this._path.push('');
} }
} else if ('.' === buffer && '/' !== c && '\\' !== c) { } else if (buffer === '.' && '/' !== c && '\\' !== c) {
this._path.push(''); this._path.push('');
} else if ('.' !== buffer) { } else if ('.' !== buffer) {
if ('file' === this._scheme && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') {
buffer = buffer[0] + ':'; buffer = buffer[0] + ':';
} }
this._path.push(buffer); this._path.push(buffer);
} }
buffer = ''; buffer = '';
if ('?' === c) { if (c === '?') {
this._query = '?'; this._query = '?';
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} }
@ -2023,7 +2023,7 @@
} }
break; break;
case 'query': case 'query':
if (!stateOverride && '#' === c) { if (!stateOverride && c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { } else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) {
@ -2127,27 +2127,27 @@
parse.call(this, pathname, 'relative path start'); parse.call(this, pathname, 'relative path start');
}, },
get search() { get search() {
return this._isInvalid || !this._query || '?' === this._query ? '' : this._query; return this._isInvalid || !this._query || this._query === '?' ? '' : this._query;
}, },
set search(search) { set search(search) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
this._query = '?'; this._query = '?';
if ('?' === search[0]) { if (search[0] === '?') {
search = search.slice(1); search = search.slice(1);
} }
parse.call(this, search, 'query'); parse.call(this, search, 'query');
}, },
get hash() { get hash() {
return this._isInvalid || !this._fragment || '#' === this._fragment ? '' : this._fragment; return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment;
}, },
set hash(hash) { set hash(hash) {
if (this._isInvalid) { if (this._isInvalid) {
return; return;
} }
this._fragment = '#'; this._fragment = '#';
if ('#' === hash[0]) { if (hash[0] === '#') {
hash = hash.slice(1); hash = hash.slice(1);
} }
parse.call(this, hash, 'fragment'); parse.call(this, hash, 'fragment');

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

84
build/pdf.worker.js vendored

@ -23,8 +23,8 @@
} }
}(this, function (exports) { }(this, function (exports) {
'use strict'; 'use strict';
var pdfjsVersion = '1.6.465'; var pdfjsVersion = '1.6.467';
var pdfjsBuild = 'f8e793f'; var pdfjsBuild = '54d55e8';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -4363,7 +4363,7 @@
this._isInvalid = true; this._isInvalid = true;
} }
function IDNAToASCII(h) { function IDNAToASCII(h) {
if ('' === h) { if (h === '') {
invalid.call(this); invalid.call(this);
} }
return h.toLowerCase(); return h.toLowerCase();
@ -4421,7 +4421,7 @@
case 'scheme': case 'scheme':
if (c && ALPHANUMERIC.test(c)) { if (c && ALPHANUMERIC.test(c)) {
buffer += c.toLowerCase(); buffer += c.toLowerCase();
} else if (':' === c) { } else if (c === ':') {
this._scheme = buffer; this._scheme = buffer;
buffer = ''; buffer = '';
if (stateOverride) { if (stateOverride) {
@ -4430,7 +4430,7 @@
if (isRelativeScheme(this._scheme)) { if (isRelativeScheme(this._scheme)) {
this._isRelative = true; this._isRelative = true;
} }
if ('file' === this._scheme) { if (this._scheme === 'file') {
state = 'relative'; state = 'relative';
} else if (this._isRelative && base && base._scheme === this._scheme) { } else if (this._isRelative && base && base._scheme === this._scheme) {
state = 'relative or authority'; state = 'relative or authority';
@ -4452,10 +4452,10 @@
} }
break; break;
case 'scheme data': case 'scheme data':
if ('?' === c) { if (c === '?') {
this._query = '?'; this._query = '?';
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} else { } else {
@ -4474,7 +4474,7 @@
} }
break; break;
case 'relative or authority': case 'relative or authority':
if ('/' === c && '/' === input[cursor + 1]) { if (c === '/' && input[cursor + 1] === '/') {
state = 'authority ignore slashes'; state = 'authority ignore slashes';
} else { } else {
err('Expected /, got: ' + c); err('Expected /, got: ' + c);
@ -4495,12 +4495,12 @@
this._username = base._username; this._username = base._username;
this._password = base._password; this._password = base._password;
break loop; break loop;
} else if ('/' === c || '\\' === c) { } else if (c === '/' || c === '\\') {
if ('\\' === c) { if (c === '\\') {
err('\\ is an invalid code point.'); err('\\ is an invalid code point.');
} }
state = 'relative slash'; state = 'relative slash';
} else if ('?' === c) { } else if (c === '?') {
this._host = base._host; this._host = base._host;
this._port = base._port; this._port = base._port;
this._path = base._path.slice(); this._path = base._path.slice();
@ -4508,7 +4508,7 @@
this._username = base._username; this._username = base._username;
this._password = base._password; this._password = base._password;
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._host = base._host; this._host = base._host;
this._port = base._port; this._port = base._port;
this._path = base._path.slice(); this._path = base._path.slice();
@ -4533,11 +4533,11 @@
} }
break; break;
case 'relative slash': case 'relative slash':
if ('/' === c || '\\' === c) { if (c === '/' || c === '\\') {
if ('\\' === c) { if (c === '\\') {
err('\\ is an invalid code point.'); err('\\ is an invalid code point.');
} }
if ('file' === this._scheme) { if (this._scheme === 'file') {
state = 'file host'; state = 'file host';
} else { } else {
state = 'authority ignore slashes'; state = 'authority ignore slashes';
@ -4554,7 +4554,7 @@
} }
break; break;
case 'authority first slash': case 'authority first slash':
if ('/' === c) { if (c === '/') {
state = 'authority second slash'; state = 'authority second slash';
} else { } else {
err('Expected \'/\', got: ' + c); err('Expected \'/\', got: ' + c);
@ -4578,7 +4578,7 @@
} }
break; break;
case 'authority': case 'authority':
if ('@' === c) { if (c === '@') {
if (seenAt) { if (seenAt) {
err('@ already seen.'); err('@ already seen.');
buffer += '%40'; buffer += '%40';
@ -4586,11 +4586,11 @@
seenAt = true; seenAt = true;
for (var i = 0; i < buffer.length; i++) { for (var i = 0; i < buffer.length; i++) {
var cp = buffer[i]; var cp = buffer[i];
if ('\t' === cp || '\n' === cp || '\r' === cp) { if (cp === '\t' || cp === '\n' || cp === '\r') {
err('Invalid whitespace in authority.'); err('Invalid whitespace in authority.');
continue; continue;
} }
if (':' === cp && null === this._password) { if (cp === ':' && this._password === null) {
this._password = ''; this._password = '';
continue; continue;
} }
@ -4602,7 +4602,7 @@
} }
} }
buffer = ''; buffer = '';
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
cursor -= buffer.length; cursor -= buffer.length;
buffer = ''; buffer = '';
state = 'host'; state = 'host';
@ -4612,7 +4612,7 @@
} }
break; break;
case 'file host': case 'file host':
if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) {
state = 'relative path'; state = 'relative path';
} else if (buffer.length === 0) { } else if (buffer.length === 0) {
@ -4623,7 +4623,7 @@
state = 'relative path start'; state = 'relative path start';
} }
continue; continue;
} else if ('\t' === c || '\n' === c || '\r' === c) { } else if (c === '\t' || c === '\n' || c === '\r') {
err('Invalid whitespace in file host.'); err('Invalid whitespace in file host.');
} else { } else {
buffer += c; buffer += c;
@ -4631,14 +4631,14 @@
break; break;
case 'host': case 'host':
case 'hostname': case 'hostname':
if (':' === c && !seenBracket) { if (c === ':' && !seenBracket) {
this._host = IDNAToASCII.call(this, buffer); this._host = IDNAToASCII.call(this, buffer);
buffer = ''; buffer = '';
state = 'port'; state = 'port';
if ('hostname' === stateOverride) { if (stateOverride === 'hostname') {
break loop; break loop;
} }
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') {
this._host = IDNAToASCII.call(this, buffer); this._host = IDNAToASCII.call(this, buffer);
buffer = ''; buffer = '';
state = 'relative path start'; state = 'relative path start';
@ -4647,9 +4647,9 @@
} }
continue; continue;
} else if ('\t' !== c && '\n' !== c && '\r' !== c) { } else if ('\t' !== c && '\n' !== c && '\r' !== c) {
if ('[' === c) { if (c === '[') {
seenBracket = true; seenBracket = true;
} else if (']' === c) { } else if (c === ']') {
seenBracket = false; seenBracket = false;
} }
buffer += c; buffer += c;
@ -4660,7 +4660,7 @@
case 'port': case 'port':
if (/[0-9]/.test(c)) { if (/[0-9]/.test(c)) {
buffer += c; buffer += c;
} else if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c || stateOverride) { } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) {
if ('' !== buffer) { if ('' !== buffer) {
var temp = parseInt(buffer, 10); var temp = parseInt(buffer, 10);
if (temp !== relative[this._scheme]) { if (temp !== relative[this._scheme]) {
@ -4673,14 +4673,14 @@
} }
state = 'relative path start'; state = 'relative path start';
continue; continue;
} else if ('\t' === c || '\n' === c || '\r' === c) { } else if (c === '\t' || c === '\n' || c === '\r') {
err('Invalid code point in port: ' + c); err('Invalid code point in port: ' + c);
} else { } else {
invalid.call(this); invalid.call(this);
} }
break; break;
case 'relative path start': case 'relative path start':
if ('\\' === c) { if (c === '\\') {
err('\'\\\' not allowed in path.'); err('\'\\\' not allowed in path.');
} }
state = 'relative path'; state = 'relative path';
@ -4689,32 +4689,32 @@
} }
break; break;
case 'relative path': case 'relative path':
if (EOF === c || '/' === c || '\\' === c || !stateOverride && ('?' === c || '#' === c)) { if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) {
if ('\\' === c) { if (c === '\\') {
err('\\ not allowed in relative path.'); err('\\ not allowed in relative path.');
} }
var tmp; var tmp;
if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
buffer = tmp; buffer = tmp;
} }
if ('..' === buffer) { if (buffer === '..') {
this._path.pop(); this._path.pop();
if ('/' !== c && '\\' !== c) { if ('/' !== c && '\\' !== c) {
this._path.push(''); this._path.push('');
} }
} else if ('.' === buffer && '/' !== c && '\\' !== c) { } else if (buffer === '.' && '/' !== c && '\\' !== c) {
this._path.push(''); this._path.push('');
} else if ('.' !== buffer) { } else if ('.' !== buffer) {
if ('file' === this._scheme && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') {
buffer = buffer[0] + ':'; buffer = buffer[0] + ':';
} }
this._path.push(buffer); this._path.push(buffer);
} }
buffer = ''; buffer = '';
if ('?' === c) { if (c === '?') {
this._query = '?'; this._query = '?';
state = 'query'; state = 'query';
} else if ('#' === c) { } else if (c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} }
@ -4723,7 +4723,7 @@
} }
break; break;
case 'query': case 'query':
if (!stateOverride && '#' === c) { if (!stateOverride && c === '#') {
this._fragment = '#'; this._fragment = '#';
state = 'fragment'; state = 'fragment';
} else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { } else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) {
@ -4827,27 +4827,27 @@
parse.call(this, pathname, 'relative path start'); parse.call(this, pathname, 'relative path start');
}, },
get search() { get search() {
return this._isInvalid || !this._query || '?' === this._query ? '' : this._query; return this._isInvalid || !this._query || this._query === '?' ? '' : this._query;
}, },
set search(search) { set search(search) {
if (this._isInvalid || !this._isRelative) { if (this._isInvalid || !this._isRelative) {
return; return;
} }
this._query = '?'; this._query = '?';
if ('?' === search[0]) { if (search[0] === '?') {
search = search.slice(1); search = search.slice(1);
} }
parse.call(this, search, 'query'); parse.call(this, search, 'query');
}, },
get hash() { get hash() {
return this._isInvalid || !this._fragment || '#' === this._fragment ? '' : this._fragment; return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment;
}, },
set hash(hash) { set hash(hash) {
if (this._isInvalid) { if (this._isInvalid) {
return; return;
} }
this._fragment = '#'; this._fragment = '#';
if ('#' === hash[0]) { if (hash[0] === '#') {
hash = hash.slice(1); hash = hash.slice(1);
} }
parse.call(this, hash, 'fragment'); parse.call(this, hash, 'fragment');

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.6.465", "version": "1.6.467",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

Loading…
Cancel
Save