Changed
- Emscripten output now hoists every clean export (free functions, classes,
enums, plus their finalization registries and string-enum tables) out of the
$initBindgeninit closure into its own top-leveladdToLibrarysymbol and self-registers it intoEXPORTED_FUNCTIONS. emscripten then emits the clean API (add,Counter, ...) as named ESM exports under-sMODULARIZE=instanceand asModule.<name>properties (via each symbol's__postset) in factory mode, with no extra sidecar files. Namespaced exports are reached through their namespace root (e.g.app), assembled in the root symbol's__postset. User module/inline-js imports are now wired asaddToLibraryshims (they were previously dropped, since emcc resolves imports only againstenv), and their ESM-imported bindings are__wbg_-prefixed to avoid colliding with emcc runtime names such asModule/HEAP8. #5210
Fixed
-
The descriptor interpreter now follows emscripten
invoke_*trampolines. emscripten's exception/longjmp lowering rewrites direct calls into indirect calls through the function table wrapped in importedinvoke_*(fnptr, ..args)helpers, including the describe helpers a descriptor function must reach. The interpreter resolvesfnptragainst the reconstructed function table, forwards the trailing arguments, and evaluates the surrounding "did it throw?" control flow (if/else,loop,br_table), so descriptors are interpreted correctly on emscripten builds with unwinding/longjmp enabled. #5215 -
Relaxed alignment requirement for 8-byte types. #5204