Debian Codegraph @

compiler/natives/src/os/os.go

raw
1 // +build js
2
3 package os
4
5 import (
6 "errors"
7
8 "github.com/gopherjs/gopherjs/js"
9 )
10
11 func runtime_args() []string { // not called on Windows
12 return Args
13 }
14
15 func init() {
16 if process := js.Global.Get("process"); process != js.Undefined {
17 argv := process.Get("argv")
18 Args = make([]string, argv.Length()-1)
19 for i := 0; i < argv.Length()-1; i++ {
20 Args[i] = argv.Index(i + 1).String()
21 }
22 }
23 if len(Args) == 0 {
24 Args = []string{"?"}
25 }
26 }
27
28 func runtime_beforeExit() {}
29
30 func executable() (string, error) {
31 return "", errors.New("Executable not implemented for GOARCH=js")
32 }