1
0
mirror of https://github.com/golang/go synced 2024-09-23 19:20:13 -06:00
go/misc/wasm
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
..
go_js_wasm_exec misc/wasm: add scripts for running WebAssembly binaries 2018-03-30 05:13:31 +00:00
wasm_exec.html misc/wasm: add mention of polyfill for Edge support 2018-10-02 17:25:11 +00:00
wasm_exec.js syscall/js: garbage collect references to JavaScript values 2019-11-04 22:50:43 +00:00