Skip to content

Commit

Permalink
Fixed crossed assert in Fetch (#3733).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 4, 2023
1 parent 8d5a13f commit 6c338c1
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 6c338c1

Please sign in to comment.