Skip to content

Commit c8fb6ae

Browse files
dmitshurgopherbot
authored andcommitted
lib/wasm: provide fs.constants.O_DIRECTORY definition
CL 606658 added a constants.Get("O_DIRECTORY").Int() call at init time, which panics in browsers because O_DIRECTORY is undefined. It needs to be a JavaScript number to avoid that. Fixes #70723. Change-Id: I727240bd25b47401d14a5e1a364d460708803f1f Reviewed-on: https://go-review.googlesource.com/c/go/+/634455 TryBot-Bypass: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Zxilly Chou <[email protected]>
1 parent 8c3e391 commit c8fb6ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/wasm/wasm_exec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if (!globalThis.fs) {
1515
let outputBuf = "";
1616
globalThis.fs = {
17-
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
17+
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 }, // unused
1818
writeSync(fd, buf) {
1919
outputBuf += decoder.decode(buf);
2020
const nl = outputBuf.lastIndexOf("\n");

0 commit comments

Comments
 (0)