[Firefox] Exclude more workerPort related code in MOZCENTRAL builds

Given that this code is (and has always been) unused in the Firefox PDF Viewer, we don't need to include it in that build-target.
This commit is contained in:
Jonas Jenwald 2023-08-19 15:52:00 +02:00
parent 5828ac0ee3
commit 2993c7725b

View File

@ -2077,7 +2077,10 @@ class PDFWorker {
this._webWorker = null;
this._messageHandler = null;
if (port) {
if (
(typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) &&
port
) {
if (PDFWorker.#workerPorts.has(port)) {
throw new Error("Cannot use more than one PDFWorker per port.");
}
@ -2113,6 +2116,9 @@ class PDFWorker {
}
_initializeFromPort(port) {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
throw new Error("Not implemented: _initializeFromPort");
}
this._port = port;
this._messageHandler = new MessageHandler("main", "worker", port);
this._messageHandler.on("ready", function () {