commit | ecba83520d4c34870e0f5f0997d59d4496957240 | [log] [tgz] |
---|---|---|
author | Richard Musiol <mail@richard-musiol.de> | Tue Oct 08 00:58:26 2019 +0200 |
committer | Brad Fitzpatrick <bradfitz@golang.org> | Tue Oct 08 02:42:57 2019 +0000 |
tree | 318b215f71f84b3e7a92016874a3e7bed8faa9e4 | |
parent | 01ff213a51a6713958f80619f483eb2e731e034a [diff] |
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>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.