Skip to content

Commit 52cc139

Browse files
authored
Move main loop handling code to library_eventloop.js. NFC (#22615)
This means that programs that use the main event loops don't need to depend on the `Browser` object. We already supported and test the main loops handling code on node, but programs that only use the event loop without any other `Browser` functions no longer need to pull in the whole `Browser` object.
1 parent d5fba03 commit 52cc139

14 files changed

+422
-410
lines changed

src/library_async.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ addToLibrary({
343343
#endif
344344
Asyncify.state = Asyncify.State.Rewinding;
345345
runAndAbortIfError(() => _asyncify_start_rewind(Asyncify.currData));
346-
if (typeof Browser != 'undefined' && Browser.mainLoop.func) {
347-
Browser.mainLoop.resume();
346+
if (typeof MainLoop != 'undefined' && MainLoop.func) {
347+
MainLoop.resume();
348348
}
349349
var asyncWasmReturnValue, isError = false;
350350
try {
@@ -391,8 +391,8 @@ addToLibrary({
391391
#if ASYNCIFY_DEBUG
392392
dbg(`ASYNCIFY: start unwind ${Asyncify.currData}`);
393393
#endif
394-
if (typeof Browser != 'undefined' && Browser.mainLoop.func) {
395-
Browser.mainLoop.pause();
394+
if (typeof MainLoop != 'undefined' && MainLoop.func) {
395+
MainLoop.pause();
396396
}
397397
runAndAbortIfError(() => _asyncify_start_unwind(Asyncify.currData));
398398
}

0 commit comments

Comments
 (0)