]> Cypherpunks repositories - gostls13.git/commit
syscall/js: add Value.Type
authorRichard Musiol <mail@richard-musiol.de>
Thu, 5 Jul 2018 17:30:00 +0000 (19:30 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 9 Jul 2018 22:51:14 +0000 (22:51 +0000)
commite97ef4127f153a2eb8b26685943310d4d19d5b60
treeb8ecc41581c6ed11a6309dadba6b3951c87965e4
parent7951d90bc6fab62b2baacdc985156c50f1063706
syscall/js: add Value.Type

This commits adds Value.Type(), which returns the JavaScript type of
a Value.

The implementation uses two previously unused bits of the NaN payload
to encode type information.

Change-Id: I568609569983791d50d35b8d80c44f3472203511
Reviewed-on: https://go-review.googlesource.com/122375
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/wasm/wasm_exec.js
src/syscall/js/js.go
src/syscall/js/js_test.go