Skip to content

Commit 130c494

Browse files
feat(cli): Support node v22 and v23 (#2207)
Co-authored-by: Oscar Spencer <oscar.spen@gmail.com>
1 parent d176be5 commit 130c494

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cli/bin/grainrun.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ const v8 = require("v8");
88
* This method should be used with care. Changing settings after the VM has started may result
99
* in unpredictable behavior, including crashes and data loss; or it may simply do nothing.
1010
*
11-
* This seems to work for our needs with Node 18, but we should be cautious when updating.
11+
* This is valid in Node 18, 19, 20, and 21.
1212
*/
13-
v8.setFlagsFromString("--experimental-wasm-return-call");
13+
if (process.version.match(/^v(18|19|20|21)\./))
14+
v8.setFlagsFromString("--experimental-wasm-return-call");
1415

1516
const { readFile } = require("fs/promises");
1617
const { WASI } = require("wasi");

0 commit comments

Comments
 (0)