Skip to content

Commit 6ee6182

Browse files
committed
chore: cleanup
1 parent 1511dd0 commit 6ee6182

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/core/globals/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ function registerOnGlobalContext(moduleName: string, exportName: string): void {
292292
});
293293
}
294294

295-
export function installPolyfills(moduleName: string, exportNames: string[], options?: { eager?: boolean }) {
296-
const shouldInstallEagerly = global.__snapshot || options?.eager;
295+
export function installPolyfills(moduleName: string, exportNames: string[]) {
296+
const shouldInstallEagerly = global.__snapshot || !__COMMONJS__;
297297
if (shouldInstallEagerly) {
298298
const loadedModule = global.loadModule(moduleName);
299299
installPolyfillsFromModule(loadedModule, exportNames as any);
@@ -306,8 +306,7 @@ if (!global.NativeScriptHasPolyfilled) {
306306
global.NativeScriptHasPolyfilled = true;
307307
// console.log('Installing polyfills...');
308308
global.registerModule('timer', () => timer);
309-
// Timer polyfills are installed eagerly because they are fundamental APIs needed very early
310-
installPolyfills('timer', ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval'], { eager: true });
309+
installPolyfills('timer', ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval']);
311310

312311
global.registerModule('animation', () => animationFrame);
313312
installPolyfills('animation', ['requestAnimationFrame', 'cancelAnimationFrame']);

0 commit comments

Comments
 (0)