Skip to content

Commit ecccdcc

Browse files
ncwRichard Musiol
authored and
Richard Musiol
committed
misc/wasm: fix panic on os.Stdout.Sync() in the browser
Before this change running os.Stdout.Sync() in the browser would panic the application with: panic: syscall/js: Value.Call: property fsync is not a function, got undefined Afterwards Sync() becomes a noop for compatibility reasons. Change-Id: I1fcef694beb35fdee3173f87371e1ff233b15d32 Reviewed-on: https://go-review.googlesource.com/c/143138 Reviewed-by: Richard Musiol <[email protected]> Run-TryBot: Richard Musiol <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 2e88689 commit ecccdcc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

misc/wasm/wasm_exec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
err.code = "ENOSYS";
6060
callback(err);
6161
},
62+
fsync(fd, callback) {
63+
callback(null);
64+
},
6265
};
6366
}
6467

0 commit comments

Comments
 (0)