We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 59aa136 + ef6746a commit df0fbb1Copy full SHA for df0fbb1
compiler/natives/src/runtime/runtime.go
@@ -80,7 +80,7 @@ func init() {
80
81
func GOROOT() string {
82
process := js.Global.Get("process")
83
- if process == js.Undefined {
+ if process == js.Undefined || process.Get("env") == js.Undefined {
84
return "/"
85
}
86
if v := process.Get("env").Get("GOPHERJS_GOROOT"); v != js.Undefined && v.String() != "" {
compiler/natives/src/syscall/syscall_js_wasm.go
@@ -10,6 +10,9 @@ func runtime_envs() []string {
10
return nil
11
12
jsEnv := process.Get("env")
13
+ if jsEnv.IsUndefined() {
14
+ return nil
15
+ }
16
envkeys := js.Global().Get("Object").Call("keys", jsEnv)
17
envs := make([]string, envkeys.Length())
18
for i := 0; i < envkeys.Length(); i++ {
0 commit comments