@@ -736,67 +736,6 @@ async function createWasm() {
736736 /** @type {!Uint8Array } */
737737 var HEAPU8 ;
738738
739- var runDependencies = 0 ;
740-
741-
742- var dependenciesFulfilled = null ;
743-
744- var runDependencyTracking = {
745- } ;
746-
747- var runDependencyWatcher = null ;
748- var removeRunDependency = ( id ) => {
749- runDependencies -- ;
750-
751- assert ( id , 'removeRunDependency requires an ID' ) ;
752- assert ( runDependencyTracking [ id ] ) ;
753- delete runDependencyTracking [ id ] ;
754- if ( runDependencies == 0 ) {
755- if ( runDependencyWatcher !== null ) {
756- clearInterval ( runDependencyWatcher ) ;
757- runDependencyWatcher = null ;
758- }
759- if ( dependenciesFulfilled ) {
760- var callback = dependenciesFulfilled ;
761- dependenciesFulfilled = null ;
762- callback ( ) ; // can add another dependenciesFulfilled
763- }
764- }
765- } ;
766-
767-
768- var addRunDependency = ( id ) => {
769- runDependencies ++ ;
770-
771- assert ( id , 'addRunDependency requires an ID' )
772- assert ( ! runDependencyTracking [ id ] ) ;
773- runDependencyTracking [ id ] = 1 ;
774- if ( runDependencyWatcher === null && globalThis . setInterval ) {
775- // Check for missing dependencies every few seconds
776- runDependencyWatcher = setInterval ( ( ) => {
777- if ( ABORT ) {
778- clearInterval ( runDependencyWatcher ) ;
779- runDependencyWatcher = null ;
780- return ;
781- }
782- var shown = false ;
783- for ( var dep in runDependencyTracking ) {
784- if ( ! shown ) {
785- shown = true ;
786- err ( 'still waiting on run dependencies:' ) ;
787- }
788- err ( `dependency: ${ dep } ` ) ;
789- }
790- if ( shown ) {
791- err ( '(end of list)' ) ;
792- }
793- } , 10000 ) ;
794- // Prevent this timer from keeping the runtime alive if nothing
795- // else is.
796- runDependencyWatcher . unref ?. ( )
797- }
798- } ;
799-
800739 var callRuntimeCallbacks = ( callbacks ) => {
801740 while ( callbacks . length > 0 ) {
802741 // Pass the module as the first argument.
@@ -831,7 +770,6 @@ async function createWasm() {
831770 return '0x' + ptr . toString ( 16 ) . padStart ( 8 , '0' ) ;
832771 }
833772
834-
835773
836774 /**
837775 * @param {number } ptr
@@ -953,6 +891,8 @@ Module['FS_createPreloadedFile'] = FS.createPreloadedFile;
953891 'mmapAlloc' ,
954892 'HandleAllocator' ,
955893 'getUniqueRunDependency' ,
894+ 'addRunDependency' ,
895+ 'removeRunDependency' ,
956896 'addOnPreRun' ,
957897 'addOnInit' ,
958898 'addOnPostCtor' ,
@@ -1103,8 +1043,6 @@ missingLibrarySymbols.forEach(missingLibrarySymbol)
11031043 'wasmTable' ,
11041044 'wasmMemory' ,
11051045 'noExitRuntime' ,
1106- 'addRunDependency' ,
1107- 'removeRunDependency' ,
11081046 'freeTableIndexes' ,
11091047 'functionsInTableMap' ,
11101048 'setValue' ,
@@ -1380,21 +1318,10 @@ function stackCheckInit() {
13801318
13811319function run ( ) {
13821320
1383- if ( runDependencies > 0 ) {
1384- dependenciesFulfilled = run ;
1385- return ;
1386- }
1387-
13881321 stackCheckInit ( ) ;
13891322
13901323 preRun ( ) ;
13911324
1392- // a preRun added a dependency, run will be called later
1393- if ( runDependencies > 0 ) {
1394- dependenciesFulfilled = run ;
1395- return ;
1396- }
1397-
13981325 function doRun ( ) {
13991326 // run may have just been called through dependencies being fulfilled just in this very frame,
14001327 // or while the async setStatus time below was happening
0 commit comments