You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run a very simple program using argv.
argv.js:
import{argv}from'process';console.log(argv);
But it seems to be undefined
wasmedge --dir=. wasmedge_quickjs.wasm argv.js foo bar baz
undefined
Tried wasmedge --dir=. wasmedge_quickjs.wasm argv.js -- foo bar baz as well just in case but with same result.
I see argv should be set to globalThis.argv, which I assume should be initialized by quickjs itself, calling the WASI function to fetch arguments, but it seems to not be happening.
@anuraaga I apologize for the confusion, and thank you for bringing up the question. I'm not very familiar with JavaScript myself, so I initially thought that arguments were obtained using 'args'.
I am trying to run a very simple program using
argv
.argv.js:
But it seems to be undefined
Tried
wasmedge --dir=. wasmedge_quickjs.wasm argv.js -- foo bar baz
as well just in case but with same result.I see
argv
should be set toglobalThis.argv
, which I assume should be initialized by quickjs itself, calling the WASI function to fetch arguments, but it seems to not be happening.https://github.com/second-state/wasmedge-quickjs/blob/main/modules/process.js#L9C28-L9C28
env
, initialized in the same pattern, seems to work fineenv.js:
I have tried both the latest release
wasmedge_quickjs.wasm
and one I built myself from commitebad9e74
(before TLS addition).The text was updated successfully, but these errors were encountered: