@@ -68,10 +68,12 @@ export class CancelablePromise<T> implements Promise<T> {
68
68
#resolve?: (value: T | PromiseLike<T>) => void;
69
69
#reject?: (reason?: any) => void;
70
70
71
- constructor(executor: (
72
- resolve: (value: T | PromiseLike<T>) => void,
73
- reject: (reason?: any) => void,
74
- onCancel: (cancelHandler: () => void) => void) => void,
71
+ constructor(
72
+ executor: (
73
+ resolve: (value: T | PromiseLike<T>) => void,
74
+ reject: (reason?: any) => void,
75
+ onCancel: (cancelHandler: () => void) => void
76
+ ) => void
75
77
) {
76
78
this.#isPending = true;
77
79
this.#isCanceled = false;
@@ -127,7 +129,7 @@ export class CancelablePromise<T> implements Promise<T> {
127
129
for (const cancelHandler of this.#cancelHandlers) {
128
130
cancelHandler();
129
131
}
130
- } catch (error) {
132
+ } catch(error) {
131
133
this.#reject?.(error);
132
134
return;
133
135
}
@@ -2537,10 +2539,12 @@ export class CancelablePromise<T> implements Promise<T> {
2537
2539
#resolve?: (value: T | PromiseLike<T>) => void;
2538
2540
#reject?: (reason?: any) => void;
2539
2541
2540
- constructor(executor: (
2541
- resolve: (value: T | PromiseLike<T>) => void,
2542
- reject: (reason?: any) => void,
2543
- onCancel: (cancelHandler: () => void) => void) => void,
2542
+ constructor(
2543
+ executor: (
2544
+ resolve: (value: T | PromiseLike<T>) => void,
2545
+ reject: (reason?: any) => void,
2546
+ onCancel: (cancelHandler: () => void) => void
2547
+ ) => void
2544
2548
) {
2545
2549
this.#isPending = true;
2546
2550
this.#isCanceled = false;
@@ -2596,7 +2600,7 @@ export class CancelablePromise<T> implements Promise<T> {
2596
2600
for (const cancelHandler of this.#cancelHandlers) {
2597
2601
cancelHandler();
2598
2602
}
2599
- } catch (error) {
2603
+ } catch(error) {
2600
2604
this.#reject?.(error);
2601
2605
return;
2602
2606
}
0 commit comments