mirror of
https://github.com/golang/go.git
synced 2025-11-10 21:51:05 +00:00
syscall/js: prepare IDs for the preset objects
Fixes #38899 Change-Id: Ib8131c3078c60dc3fe2cf0eaac45b25a4f6e4649 Reviewed-on: https://go-review.googlesource.com/c/go/+/232518 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Richard Musiol <neelance@gmail.com>
This commit is contained in:
parent
8c1db77a92
commit
a0698a6b60
2 changed files with 32 additions and 27 deletions
|
|
@ -591,3 +591,14 @@ func BenchmarkDOM(b *testing.B) {
|
|||
document.Get("body").Call("removeChild", div)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGlobal(t *testing.T) {
|
||||
ident := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||
return args[0]
|
||||
})
|
||||
defer ident.Release()
|
||||
|
||||
if got := ident.Invoke(js.Global()); !got.Equal(js.Global()) {
|
||||
t.Errorf("got %#v, want %#v", got, js.Global())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue