1
0
mirror of https://github.com/golang/go synced 2024-11-24 03:50:18 -07:00
go/misc
Richard Musiol 54e6ba6724 syscall/js: garbage collect references to JavaScript values
The js.Value struct now contains a pointer, so a finalizer can
determine if the value is not referenced by Go any more.

Unfortunately this breaks Go's == operator with js.Value. This change
adds a new Equal method to check for the equality of two Values.
This is a breaking change. The == operator is now disallowed to
not silently break code.

Additionally the helper methods IsUndefined, IsNull and IsNaN got added.

Fixes #35111

Change-Id: I58a50ca18f477bf51a259c668a8ba15bfa76c955
Reviewed-on: https://go-review.googlesource.com/c/go/+/203600
Run-TryBot: Richard Musiol <neelance@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-11-04 22:50:43 +00:00
..
android misc/android: fix a typo in README 2019-05-17 06:01:17 +00:00
arm
cgo misc/cgo/testcarchive: add missing exit(0) in main7.c 2019-11-04 05:27:25 +00:00
chrome/gophertool
ios misc/ios: add missing CGO_ENABLED=1 for running standalone tests 2019-06-15 06:19:57 +00:00
linkcheck
reboot cmd/go: include GOEXPERIMENT flags in tool id for cache key 2019-07-17 22:57:03 +00:00
swig
trace all: remove trailing whitespace from HTML files 2019-09-18 18:32:20 +00:00
wasm syscall/js: garbage collect references to JavaScript values 2019-11-04 22:50:43 +00:00
editors
go.mod misc: add go.mod file 2019-02-27 17:47:31 +00:00