mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: restore WaitTask terminate condition (#9612)
This commit is contained in:
parent
40068a7d86
commit
e16cbc6626
@ -177,10 +177,11 @@ export class WaitTask<T = unknown> {
|
|||||||
async terminate(error?: unknown): Promise<void> {
|
async terminate(error?: unknown): Promise<void> {
|
||||||
this.#world.taskManager.delete(this);
|
this.#world.taskManager.delete(this);
|
||||||
|
|
||||||
if (error && !this.#result.finished()) {
|
|
||||||
if (this.#timeout) {
|
if (this.#timeout) {
|
||||||
clearTimeout(this.#timeout);
|
clearTimeout(this.#timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error && !this.#result.finished()) {
|
||||||
this.#result.reject(error);
|
this.#result.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user