Skip to content

Commit 9694289

Browse files
committed
fix: correctly polyfill AbortController and AbortSignal
1 parent 3bf6a5d commit 9694289

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

packages/angular/polyfills/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AbortController, AbortSignal } from '@nativescript/core/abortcontroller';
12
export const nsNgPolyfills = true;
23

34
global.performance ??= {} as unknown as Performance;
@@ -33,4 +34,12 @@ for (const key in polyfilledPerformance) {
3334

3435
if (typeof queueMicrotask === 'undefined') {
3536
global.queueMicrotask = (cb) => Promise.resolve().then(cb);
36-
}
37+
}
38+
39+
if (typeof AbortController === 'undefined') {
40+
global.AbortController = AbortController;
41+
}
42+
43+
if (typeof AbortSignal === 'undefined') {
44+
global.AbortSignal = AbortSignal;
45+
}

packages/zone-js/dist/pre-zone-polyfills.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { AbortController, AbortSignal } from '@nativescript/core/abortcontroller';
2-
3-
(global as any).AbortController = AbortController;
4-
(global as any).AbortSignal = AbortSignal;
5-
6-
export const disabledPatches = ['legacy', 'EventTarget', 'XHR', 'MutationObserver', 'IntersectionObserver', 'FileReader'];
1+
export const disabledPatches = [
2+
'legacy',
3+
'EventTarget',
4+
'XHR',
5+
'MutationObserver',
6+
'IntersectionObserver',
7+
'FileReader',
8+
];
79

810
for (const patch of disabledPatches) {
911
global[`__Zone_disable_${patch}`] = true;

0 commit comments

Comments
 (0)