Fixes WeakMap polyfill (and improves PDFWorker port check).

This commit is contained in:
Yury Delendik 2017-06-13 09:16:12 -05:00
parent e5ac64f81f
commit 631e6bebff
2 changed files with 7 additions and 3 deletions

View file

@ -1232,7 +1232,7 @@ var PDFWorker = (function PDFWorkerClosure() {
let pdfWorkerPorts = new WeakMap();
function PDFWorker(name, port) {
if (pdfWorkerPorts.has(port)) {
if (port && pdfWorkerPorts.has(port)) {
throw new Error('Cannot use more than one PDFWorker per port');
}