]> Cypherpunks repositories - gostls13.git/commit
syscall/js: make zero js.Value represent "undefined"
authorRichard Musiol <mail@richard-musiol.de>
Thu, 18 Oct 2018 13:53:38 +0000 (15:53 +0200)
committerRichard Musiol <neelance@gmail.com>
Thu, 18 Oct 2018 15:20:30 +0000 (15:20 +0000)
commit138bfc28090ccf03450cf02cb24f06b60f57cd3b
tree75745a6050a3086851e5c26b2c6410f973475ca6
parent8ccafb1ac732ab7994acb3c40786a0b943974554
syscall/js: make zero js.Value represent "undefined"

This commit changes the encoding of js.Value so that the zero js.Value
represents the JavaScript value "undefined". This is what users
intuitively expect.

Specifically, the encodings of "undefined" and the number zero have
been swapped.

Fixes #27592.

Change-Id: Icfc832c8cdf7a8a78bd69d20e00a04dbed0ccd10
Reviewed-on: https://go-review.googlesource.com/c/143137
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/wasm/wasm_exec.js
src/syscall/js/js.go
src/syscall/js/js_test.go