Skip to content

[Mainloop 2/3] Implement "implicit" mainloop which only blocks on unresolved imports

Evan Welsh requested to merge ewlsh/top-level-await-mainloop into master

This MR adds an "implicit" mainloop (i.e. a mainloop which users don't need to explicitly run like imports.mainloop.run()). For right now this mainloop is only held (kept running) by async imports like import('./x.js').

This will unblock top-level await in mozjs91 because users will be able to use await in their entry module. If we enabled top-level await now users would not be able to use await in their entry module as they'd have no way to start a mainloop. This becomes a 🐔 🥚 problem that this MR solves.

Depends on !557 (merged)

Edited by Evan Welsh

Merge request reports