File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ export class CancelablePromise<T> implements Promise<T> {
49
49
return;
50
50
}
51
51
this.#isResolved = true;
52
- this.#resolve?. (value);
52
+ if ( this.#resolve) this.#resolve (value);
53
53
};
54
54
55
55
const onReject = (reason?: any): void => {
56
56
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
57
57
return;
58
58
}
59
59
this.#isRejected = true;
60
- this.#reject?. (reason);
60
+ if ( this.#reject) this.#reject (reason);
61
61
};
62
62
63
63
const onCancel = (cancelHandler: () => void): void => {
@@ -120,7 +120,7 @@ export class CancelablePromise<T> implements Promise<T> {
120
120
}
121
121
}
122
122
this.#cancelHandlers.length = 0;
123
- this.#reject?. (new CancelError('Request aborted'));
123
+ if ( this.#reject) this.#reject (new CancelError('Request aborted'));
124
124
}
125
125
126
126
public get isCancelled(): boolean {
Original file line number Diff line number Diff line change @@ -119,15 +119,15 @@ export class CancelablePromise<T> implements Promise<T> {
119
119
return;
120
120
}
121
121
this.#isResolved = true;
122
- this.#resolve?. (value);
122
+ if ( this.#resolve) this.#resolve (value);
123
123
};
124
124
125
125
const onReject = (reason?: any): void => {
126
126
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
127
127
return;
128
128
}
129
129
this.#isRejected = true;
130
- this.#reject?. (reason);
130
+ if ( this.#reject) this.#reject (reason);
131
131
};
132
132
133
133
const onCancel = (cancelHandler: () => void): void => {
@@ -3345,15 +3345,15 @@ export class CancelablePromise<T> implements Promise<T> {
3345
3345
return;
3346
3346
}
3347
3347
this.#isResolved = true;
3348
- this.#resolve?. (value);
3348
+ if ( this.#resolve) this.#resolve (value);
3349
3349
};
3350
3350
3351
3351
const onReject = (reason?: any): void => {
3352
3352
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
3353
3353
return;
3354
3354
}
3355
3355
this.#isRejected = true;
3356
- this.#reject?. (reason);
3356
+ if ( this.#reject) this.#reject (reason);
3357
3357
};
3358
3358
3359
3359
const onCancel = (cancelHandler: () => void): void => {
You can’t perform that action at this time.
0 commit comments