WebAssembly JavaScript builtins examples.
The wat2wasm tool does not support the JS builtins examples. To compile .wat files that make use of JavaScript builtins, you need to use the wasm-as tool, which is part of the Binaryen library. You'll need to run wasm-as with reference types and GC enabled for these examples to compile successfully:
wasm-as --enable-reference-types -–enable-gc module.wat -o module.wasmOr you can use the -all flag in place of --enable-reference-types -–enable-gc:
wasm-as -all module.wat -o module.wasm