@@ -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