Skip to content

Commit

Permalink
Fixed crossed assert in Fetch (ethers-io#3733).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent 41455be commit 7a0285b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src.ts/utils/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class FetchCancelSignal {
}

addListener(listener: () => void): void {
assert(this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", {
assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", {
operation: "fetchCancelSignal.addCancelListener"
});
this.#listeners.push(listener);
Expand All @@ -134,8 +134,7 @@ export class FetchCancelSignal {
get cancelled(): boolean { return this.#cancelled; }

checkSignal(): void {
if (!this.cancelled) { return; }
assert(false, "cancelled", "CANCELLED", { });
assert(!this.cancelled, "cancelled", "CANCELLED", { });
}
}

Expand Down

0 comments on commit 7a0285b

Please sign in to comment.