1
0
mirror of https://github.com/golang/go synced 2024-11-22 14:54:46 -07:00
go/misc
Richard Musiol ecba83520d syscall: on wasm, do not panic if "process" global is not defined
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>
2019-10-08 02:42:57 +00:00
..
android misc/android: fix a typo in README 2019-05-17 06:01:17 +00:00
arm
cgo cmd/cgo: build unique C type cache keys from parent names 2019-10-05 00:16:04 +00:00
chrome/gophertool
ios misc/ios: add missing CGO_ENABLED=1 for running standalone tests 2019-06-15 06:19:57 +00:00
linkcheck
nacl crypto/ed25519: promote from golang.org/x/crypto/ed25519 2019-05-06 23:23:45 +00:00
reboot cmd/go: include GOEXPERIMENT flags in tool id for cache key 2019-07-17 22:57:03 +00:00
swig
trace all: remove trailing whitespace from HTML files 2019-09-18 18:32:20 +00:00
wasm syscall: on wasm, do not panic if "process" global is not defined 2019-10-08 02:42:57 +00:00
benchcmp
editors
go.mod misc: add go.mod file 2019-02-27 17:47:31 +00:00