Skip to content

Commit ea91f99

Browse files
committed
fix(setupWorker): add redundant worker.stop() warning
1 parent e2af5aa commit ea91f99

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/browser/sources/service-worker-source.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ export class ServiceWorkerSource extends NetworkSource<ServiceWorkerHttpNetworkF
119119
public async disable(): Promise<void> {
120120
await super.disable()
121121

122+
if (typeof this.#stoppedAt !== 'undefined') {
123+
devUtils.warn(
124+
`Found a redundant "worker.stop()" call. Notice that stopping the worker after it has already been stopped has no effect. Consider removing this "worker.stop()" call.`,
125+
)
126+
127+
return
128+
}
129+
122130
this.#stoppedAt = Date.now()
123131
this.#frames.clear()
124132
this.workerPromise = new DeferredPromise()

0 commit comments

Comments
 (0)