diff options
author | Nick Craig-Wood <nick@craig-wood.com> | 2018-10-18 16:26:56 +0100 |
---|---|---|
committer | Richard Musiol <neelance@gmail.com> | 2018-10-20 12:11:14 +0000 |
commit | ecccdccf3e235c124a768e5474e07cfb958f8aeb (patch) | |
tree | 43937cd4dddd1ea3fe9f6af2faa7570132e74972 /misc/wasm | |
parent | 2e88689168a57ae550ddae7ad0966fa14c877c5f (diff) | |
download | go-ecccdccf3e235c124a768e5474e07cfb958f8aeb.tar.gz go-ecccdccf3e235c124a768e5474e07cfb958f8aeb.zip |
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 <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'misc/wasm')
-rw-r--r-- | misc/wasm/wasm_exec.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index bd9754e53a..78eb306253 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -59,6 +59,9 @@ err.code = "ENOSYS"; callback(err); }, + fsync(fd, callback) { + callback(null); + }, }; } |