ignore env in wasm_exec_node.js

This commit is contained in:
syumai 2024-01-06 23:43:48 +09:00
parent 7529cefdf8
commit 1ccb9094e3

View File

@ -22,7 +22,8 @@ require("./wasm_exec");
const go = new Go();
go.argv = process.argv.slice(2);
go.env = Object.assign({ TMPDIR: require("os").tmpdir() }, process.env);
// to prevent `total length of command line and environment variables exceeds limit` error, ignore env.
// go.env = Object.assign({ TMPDIR: require("os").tmpdir() }, process.env);
go.exit = process.exit;
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
process.on("exit", (code) => { // Node.js exits if no event handler is pending