fix(core): polyfill iterator helper for safari (#8824)

fix AF-1691
This commit is contained in:
forehalo 2024-11-14 09:59:01 +00:00
parent 9f3dceb220
commit 055fa0a8b4
No known key found for this signature in database
GPG Key ID: 56709255DC7EC728
2 changed files with 9 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { polyfillDispose } from './dispose'; import { polyfillDispose } from './dispose';
import { polyfillIteratorHelpers } from './iterator-helpers';
import { polyfillPromise } from './promise-with-resolvers'; import { polyfillPromise } from './promise-with-resolvers';
import { polyfillEventLoop } from './request-idle-callback'; import { polyfillEventLoop } from './request-idle-callback';
import { polyfillResizeObserver } from './resize-observer'; import { polyfillResizeObserver } from './resize-observer';
@ -7,3 +8,4 @@ polyfillResizeObserver();
polyfillEventLoop(); polyfillEventLoop();
await polyfillPromise(); await polyfillPromise();
await polyfillDispose(); await polyfillDispose();
await polyfillIteratorHelpers();

View File

@ -0,0 +1,7 @@
export async function polyfillIteratorHelpers() {
if (typeof globalThis['Iterator'] !== 'function') {
// @ts-expect-error ignore
// https://github.com/zloirock/core-js/blob/master/packages/core-js/proposals/iterator-helpers-stage-3.js
await import('core-js/proposals/iterator-helpers-stage-3');
}
}