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:
Richard Musiol 2018-06-25 12:30:31 +02:00 committed by Brad Fitzpatrick
parent 9c35c1a503
commit 5881d3048d
6 changed files with 52 additions and 46 deletions

View file

@ -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 (