Files
tinygo/targets/wasm.json
T
Victor Costa bd61913973 wasm: patch wasm_exec.js and wasm_exec_node.js from Go 1.18+ (#5483)
* wasm: patch wasm_exec.js and wasm_exec_node.js from Go 1.18+

Port this commit https://github.com/golang/go/commit/680caf15355057ca84857a2a291b6f5c44e73329 removing polyfills from `wasm_exec.js`, now the environment is expected to provide all the required polyfills.

`wasm_exec.js` now only provides stub fallbacks for globalThis.fs and globalThis.process.

All NodeJS specific code is now in a separate file `wasm_exec_node.js` with its required polyfills.

* feat: bump minimum node version to 22

Drops official support for NodeJS 18 for WASM by removing the provided polyfills in the `wasm_exec.js`.

Now the environment is expected to provide the polyfill if it is running on older NodeJS versions

The new minimum required version for WASM is NodeJS 22+.

* chore: removed wrong comment

`wasm_exec_node.js` no longer contains the polyfill for NodeJS 18
2026-07-08 12:32:00 +02:00

32 lines
879 B
JSON

{
"llvm-target": "wasm32-unknown-wasi",
"cpu": "generic",
"features": "+bulk-memory,+bulk-memory-opt,+call-indirect-overlong,+mutable-globals,+nontrapping-fptoint,+sign-ext,-multivalue,-reference-types",
"build-tags": ["tinygo.wasm"],
"goos": "js",
"goarch": "wasm",
"linker": "wasm-ld",
"libc": "wasi-libc",
"rtlib": "compiler-rt",
"gc": "precise",
"scheduler": "asyncify",
"default-stack-size": 65536,
"cflags": [
"-mbulk-memory",
"-mnontrapping-fptoint",
"-mno-multivalue",
"-mno-reference-types",
"-msign-ext"
],
"ldflags": [
"--allow-undefined-file={root}/targets/wasm-undefined.txt",
"--stack-first",
"--no-demangle"
],
"extra-files": [
"src/runtime/asm_tinygowasm.S",
"src/runtime/gc_boehm.c"
],
"emulator": "node {root}/targets/wasm_exec_node.js {}"
}