mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall/js: turn constant package vars into functions
This is so the values can not be changed and the type is easy to see. Requested on https://go-review.googlesource.com/c/go/+/120561. Change-Id: If2ed48ca3ba8874074687bfb2375d2f5592e8e0d Reviewed-on: https://go-review.googlesource.com/120564 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
9c35c1a503
commit
5881d3048d
6 changed files with 52 additions and 46 deletions
|
|
@ -15,8 +15,8 @@ import (
|
|||
// Provided by package runtime.
|
||||
func now() (sec int64, nsec int32)
|
||||
|
||||
var jsProcess = js.Global.Get("process")
|
||||
var jsFS = js.Global.Get("fs")
|
||||
var jsProcess = js.Global().Get("process")
|
||||
var jsFS = js.Global().Get("fs")
|
||||
var constants = jsFS.Get("constants")
|
||||
|
||||
var (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue