From a5db4e985abd16a14b38ff07275fb65c37692aed Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 13 Feb 2020 12:46:29 +0100 Subject: [PATCH] Remove `LoopbackPort.postMessage` special-case for polyfilled `TypedArray`s Given that all `TypedArray` polyfills were removed in PDF.js version `2.0`, since native support is now required, this branch has been dead code for awhile. --- src/display/api.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index 6d22a13de..008fb7743 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1492,10 +1492,7 @@ class LoopbackPort { if ((buffer = value.buffer) && isArrayBuffer(buffer)) { // We found object with ArrayBuffer (typed array). const transferable = transfers && transfers.includes(buffer); - if (value === buffer) { - // Special case when we are faking typed arrays in compatibility.js. - result = value; - } else if (transferable) { + if (transferable) { result = new value.constructor( buffer, value.byteOffset,