Update toStringTag in CancellablePromise

This commit is contained in:
mstosio 2023-03-01 12:15:21 +01:00
parent ec2c712901
commit 8b416381b6

View File

@ -21,8 +21,6 @@ export interface OnCancel {
}
export class CancelablePromise<T> implements Promise<T> {
readonly [Symbol.toStringTag]: string;
#isResolved: boolean;
#isRejected: boolean;
#isCancelled: boolean;
@ -85,6 +83,10 @@ export class CancelablePromise<T> implements Promise<T> {
});
}
get [Symbol.toStringTag]() {
return "Cancellable Promise";
}
public then<TResult1 = T, TResult2 = never>(
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null