From 32cb5b780d70ef2b4d093a3ff954b7fdbb691196 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 1 Mar 2021 14:32:22 -0500 Subject: [PATCH] foo --- test/wasi/test-return-on-exit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/wasi/test-return-on-exit.js b/test/wasi/test-return-on-exit.js index 362d13b490a96f..e61f4174c3d4ee 100644 --- a/test/wasi/test-return-on-exit.js +++ b/test/wasi/test-return-on-exit.js @@ -21,7 +21,8 @@ const buffer = fs.readFileSync(modulePath); // Verify that if a WASI application throws an exception, Node rethrows it // properly. const wasi = new WASI({ returnOnExit: true }); - wasi.wasiImport.proc_exit = () => { throw new Error('test error'); }; + const patchedExit = () => { throw new Error('test error'); }; + wasi.wasiImport.proc_exit = patchedExit.bind(wasi.wasiImport); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; const { instance } = await WebAssembly.instantiate(buffer, importObject);