diff --git a/src/display/api.js b/src/display/api.js index b98bdacf6..d70014d73 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1056,8 +1056,8 @@ var PDFPageProxy = (function PDFPageProxyClosure() { }, this); this.objs.clear(); this.annotationsPromise = null; - if (resetStats) { - this._stats.reset(); + if (resetStats && this._stats instanceof StatTimer) { + this._stats = new StatTimer(); } this.pendingCleanup = false; }, diff --git a/src/display/dom_utils.js b/src/display/dom_utils.js index 9c12d3c32..442d163e0 100644 --- a/src/display/dom_utils.js +++ b/src/display/dom_utils.js @@ -411,10 +411,6 @@ function isExternalLinkTargetSet() { class StatTimer { constructor(enable = true) { this.enabled = !!enable; - this.reset(); - } - - reset() { this.started = Object.create(null); this.times = []; } @@ -477,8 +473,6 @@ class DummyStatTimer { unreachable('Cannot initialize DummyStatTimer.'); } - static reset() {} - static time(name) {} static timeEnd(name) {}