Commit graph

5 commits

Author SHA1 Message Date
adam j hartz
d1d526afe7
gh-136251: Improvements to WASM demo REPL (GH-136252)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-07-21 11:56:45 +02:00
Hood Chatham
800d37feca
gh-124621: Emscripten: Fix regression in use-after-close error handling (#136837) 2025-07-19 21:43:50 +02:00
Hood Chatham
7ae4749d06
gh-124621: Emscripten: Add support for async input devices (GH-136822)
This is useful for implementing proper `input()`. It requires the
JavaScript engine to support the wasm JSPI spec which is now stage 4.
It is supported on Chrome since version 137 and on Firefox and node
behind a flag.

We override the `__wasi_fd_read()` syscall with our own variant that
checks for a readAsync operation. If it has it, we use our own async
variant of `fd_read()`, otherwise we use the original `fd_read()`.
We also add a variant of `FS.createDevice()` called
`FS.createAsyncInputDevice()`.

Finally, if JSPI is available, we wrap the `main()` symbol with
`WebAssembly.promising()` so that we can stack switch from `fd_read()`.
If JSPI is not available, attempting to read from an AsyncInputDevice
will raise an `OSError`.
2025-07-19 17:14:29 +02:00
Hood Chatham
12e52cad71
gh-127146: Emscripten: Make os.umask() actually work (#136706)
Provide a stub implementation of umask that is enough to get some tests passing.
More work is needed upstream in Emscripten to make all umask tests to pass.
2025-07-16 15:33:15 +02:00
Hood Chatham
e81c4e84b3
gh-127146: Report uid in Emscripten + node as native uid (#136509)
Corrects the handling of getuid on emscripten, which was consistently reporting as 0.
2025-07-16 06:17:16 +02:00