mirror of
https://github.com/golang/go.git
synced 2025-05-19 06:14:40 +00:00
When running wasm in the browser, the "process" global is not defined. This causes functions like os.Getpid() to panic, which is unusual. For example on Windows os.Getpid() returns -1 and does not panic. This change adds a dummy polyfill for "process" which returns -1 or an error. It also extends the polyfill for "fs". Fixes #34627 Replaces CL 199357 Change-Id: Ifeb12fe7e152c517848933a9ab5f6f749896dcef Reviewed-on: https://go-review.googlesource.com/c/go/+/199698 Run-TryBot: Richard Musiol <neelance@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>