Skip to content

[WIP] esm: basic wasm module env

The current tests for Wasm modules is only testing modules that were compiled from Wast to Wasm.

When trying to get some basic functions working that were compiled via emscripten I quickly found that those modules were expecting a gloabal env that is generated for the .js wrapper.

Here's a link to the upstream source--> https://github.com/emscripten-core/emscripten/blob/incoming/src/preamble.js#L1117-L1158

This is a really naive PR tracking my work trying to get off the shelf wasm working as modules, it seems like there are lots of edge cases. I'm not 100% we want to ship this specific, and arguably internal, details of emscripten in core... hope to use this PR for a discussion in figuring out what makes the most sense.

@nodejs/modules

Merge request reports

Loading