diff --git a/src/display/canvas.js b/src/display/canvas.js index 6cf85dffa2a1d4..d9df19a7975ff4 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -58,14 +58,6 @@ const MAX_SIZE_TO_COMPILE = 1000; const FULL_CHUNK_HEIGHT = 16; -function allValues(obj) { - const values = []; - for (const key in obj) { - values.push(obj[key]); - } - return values; -} - /** * Overrides certain methods on a 2d ctx so that when they are called they * will also call the same method on the destCtx. The methods that are @@ -619,7 +611,9 @@ class CanvasExtraStateDependenciesRecorder extends CanvasExtraState { } takeDependencies() { - if (this._dependencies.size === 0) return; + if (this._dependencies.size === 0) { + return undefined; + } const arr = Array.from(this._dependencies); this._dependencies.clear(); diff --git a/src/display/canvas_recorder.js b/src/display/canvas_recorder.js index 662b155f28f7b0..192a69678a6a15 100644 --- a/src/display/canvas_recorder.js +++ b/src/display/canvas_recorder.js @@ -268,7 +268,9 @@ export class CanvasRecorder { // console.warn(`Untracked call to ${name}`); this.#unknown(); } - if (deps) this.#registerDependencies(deps); + if (deps) { + this.#registerDependencies(deps); + } return this.#ctx[name](...args); }; }