Skip to content

Commit

Permalink
misc/wasm: fix panic on os.Stdout.Sync() in the browser
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ncw authored and Richard Musiol committed Oct 20, 2018
1 parent 2e88689 commit ecccdcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions misc/wasm/wasm_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
err.code = "ENOSYS";
callback(err);
},
fsync(fd, callback) {
callback(null);
},
};
}

Expand Down

0 comments on commit ecccdcc

Please sign in to comment.