From 3c5c8d2a0b0ea88f8c4d67d202c48a0bd59b5ff8 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 5 Jun 2018 20:29:37 +0200 Subject: [PATCH] Remove the typed array check when calling `LoopbackPort` in `PDFWorker._setupFakeWorker` With version 2.0, native support for typed arrays is now a requirement for using the PDF.js library; see PR 9094 where the old polyfills were removed. Hence the `isTypedArraysPresent` check, when setting up fake workers, no longer serves any purpose here and can thus be removed. --- src/display/api.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index b121661f8..92b842eba 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1553,12 +1553,7 @@ var PDFWorker = (function PDFWorkerClosure() { this._readyCapability.reject(new Error('Worker was destroyed')); return; } - - // We cannot turn on proper fake port simulation (this includes - // structured cloning) when typed arrays are not supported. Relying - // on a chance that messages will be sent in proper order. - var isTypedArraysPresent = Uint8Array !== Float32Array; - var port = new LoopbackPort(isTypedArraysPresent); + let port = new LoopbackPort(); this._port = port; // All fake workers use the same port, making id unique.