Limit PDFPageProxy.getOperatorList to development mode and GENERIC builds

Given that this API method isn't used anywhere within the PDF.js library itself, except for the unit-tests, we can avoid including what's effectively dead code in e.g. the *built-in* Firefox PDF Viewer.
This commit is contained in:
Jonas Jenwald 2023-06-11 12:00:03 +02:00
parent 9af50dc358
commit a8d4aad8b9

View File

@ -1552,6 +1552,9 @@ class PDFPageProxy {
annotationMode = AnnotationMode.ENABLE,
printAnnotationStorage = null,
} = {}) {
if (typeof PDFJSDev !== "undefined" && !PDFJSDev.test("GENERIC")) {
throw new Error("Not implemented: getOperatorList");
}
function operatorListChanged() {
if (intentState.operatorList.lastChunk) {
intentState.opListReadCapability.resolve(intentState.operatorList);