Use optional chaining a little bit more in the src/display/api.js file

That format is preferred where possible, since it leads to ever so slightly shorter code overall.
This commit is contained in:
Jonas Jenwald 2026-03-10 15:29:17 +01:00
parent 873378b718
commit 5ef582fb20

View File

@ -1530,10 +1530,9 @@ class PDFPageProxy {
this._pumpOperatorList(intentArgs);
}
const recordForDebugger = Boolean(
const recordForDebugger = !!(
this._pdfBug && globalThis.StepperManager?.enabled
);
const shouldRecordOperations =
!this.recordedBBoxes && (recordOperations || recordForDebugger);
@ -1543,12 +1542,11 @@ class PDFPageProxy {
if (shouldRecordOperations) {
const recordedBBoxes = internalRenderTask.gfx?.dependencyTracker.take();
if (recordedBBoxes) {
if (internalRenderTask.stepper) {
internalRenderTask.stepper.setOperatorBBoxes(
recordedBBoxes,
internalRenderTask.gfx.dependencyTracker.takeDebugMetadata()
);
}
internalRenderTask.stepper?.setOperatorBBoxes(
recordedBBoxes,
internalRenderTask.gfx.dependencyTracker.takeDebugMetadata()
);
if (recordOperations) {
this.recordedBBoxes = recordedBBoxes;
}