Commit ecccdccf authored by Nick Craig-Wood's avatar Nick Craig-Wood Committed by Richard Musiol

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/143138Reviewed-by: default avatarRichard Musiol <neelance@gmail.com>
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 2e886891
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
err.code = "ENOSYS"; err.code = "ENOSYS";
callback(err); callback(err);
}, },
fsync(fd, callback) {
callback(null);
},
}; };
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment