@@ -2296,6 +2296,68 @@ addToLibrary({
22962296
22972297 $noExitRuntime : "{{{ makeModuleReceiveExpr('noExitRuntime', !EXIT_RUNTIME) }}}" ,
22982298
2299+ // The following addOn<X> functions are for adding runtime callbacks at
2300+ // various executions points. Each addOn<X> function has a corresponding
2301+ // compiled time version named addAt<X> that will instead inline during
2302+ // compilation (see parseTools.mjs).
2303+ // Note: if there are both runtime and compile time code, the runtime
2304+ // callbacks will be invoked before the compile time code.
2305+
2306+ // See ATPRERUNS in parseTools.mjs for more information.
2307+ $onPreRuns : [ ] ,
2308+ $onPreRuns__internal : true ,
2309+ $onPreRuns__deps : [ '$callRuntimeCallbacks' ] ,
2310+ $onPreRuns__postset : ( ) => {
2311+ ATPRERUNS . unshift ( 'callRuntimeCallbacks(onPreRuns);' ) ;
2312+ } ,
2313+ $addOnPreRun__deps : [ '$onPreRuns' ] ,
2314+ $addOnPreRun : ( cb ) => onPreRuns . unshift ( cb ) ,
2315+ // See ATINITS in parseTools.mjs for more information.
2316+ $onInits : [ ] ,
2317+ $onInits__internal : true ,
2318+ $onInits__deps : [ '$callRuntimeCallbacks' ] ,
2319+ $onInits__postset : ( ) => {
2320+ ATINITS . unshift ( 'callRuntimeCallbacks(onInits);' ) ;
2321+ } ,
2322+ $addOnInit__deps : [ '$onInits' ] ,
2323+ $addOnInit : ( cb ) => onInits . unshift ( cb ) ,
2324+ // See ATPOSTCTORS in parseTools.mjs for more information.
2325+ $onPostCtors : [ ] ,
2326+ $onPostCtors__internal : true ,
2327+ $onPostCtors__deps : [ '$callRuntimeCallbacks' ] ,
2328+ $onPostCtors__postset : ( ) => {
2329+ ATPOSTCTORS . unshift ( 'callRuntimeCallbacks(onPostCtors);' ) ;
2330+ } ,
2331+ $addOnPostCtor__deps : [ '$onPostCtors' ] ,
2332+ $addOnPostCtor : ( cb ) => onPostCtors . unshift ( cb ) ,
2333+ // See ATMAINS in parseTools.mjs for more information.
2334+ $onMains : [ ] ,
2335+ $onMains__internal : true ,
2336+ $onMains__deps : [ '$callRuntimeCallbacks' ] ,
2337+ $onMains__postset : ( ) => {
2338+ ATMAINS . unshift ( 'callRuntimeCallbacks(onMains);' ) ;
2339+ } ,
2340+ $addOnPreMain__deps : [ '$onMains' ] ,
2341+ $addOnPreMain : ( cb ) => onMains . unshift ( cb ) ,
2342+ // See ATEXITS in parseTools.mjs for more information.
2343+ $onExits : [ ] ,
2344+ $onExits__internal : true ,
2345+ $onExits__deps : [ '$callRuntimeCallbacks' ] ,
2346+ $onExits__postset : ( ) => {
2347+ ATEXITS . unshift ( 'callRuntimeCallbacks(onExits);' ) ;
2348+ } ,
2349+ $addOnExit__deps : [ '$onExits' ] ,
2350+ $addOnExit : ( cb ) => onExits . unshift ( cb ) ,
2351+ // See ATPOSTRUNS in parseTools.mjs for more information.
2352+ $onPostRuns : [ ] ,
2353+ $onPostRuns__internal : true ,
2354+ $onPostRuns__deps : [ '$callRuntimeCallbacks' ] ,
2355+ $onPostRuns__postset : ( ) => {
2356+ ATPOSTRUNS . unshift ( 'callRuntimeCallbacks(onPostRuns);' ) ;
2357+ } ,
2358+ $addOnPostRun__deps : [ '$onPostRuns' ] ,
2359+ $addOnPostRun : ( cb ) => onPostRuns . unshift ( cb ) ,
2360+
22992361 // We used to define these globals unconditionally in support code.
23002362 // Instead, we now define them here so folks can pull it in explicitly, on
23012363 // demand.
0 commit comments