Skip to content

Commit

Permalink
Remove the IMAGE_DECODERS special-case when polyfilling `structuredCl…
Browse files Browse the repository at this point in the history
…one`

Originally we only used the `structuredClone` polyfill in the `LoopbackPort`-implementation, and that obviously isn't used anywhere within the various image decoders.
At this point in time we've started to use `structuredClone` a little bit more, hence it seems overall simpler to just bundle the polyfill even in the `legacy`-version of the IMAGE_DECODERS built-target.
  • Loading branch information
Snuffleupagus committed May 4, 2023
1 parent a1a51f9 commit 127e696
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/shared/compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ import { isNodeJS } from "./is_node.js";

// Support: Chrome<98, Safari<15.4
(function checkStructuredClone() {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("IMAGE_DECODERS")) {
// The current image decoders are synchronous, hence `structuredClone`
// shouldn't need to be polyfilled for the IMAGE_DECODERS build target.
return;
}
if (globalThis.structuredClone) {
return;
}
Expand Down

0 comments on commit 127e696

Please sign in to comment.