]> Cypherpunks repositories - gostls13.git/commit
misc/wasm: fix passing large negative integers from JS to Go
authorRichard Musiol <mail@richard-musiol.de>
Mon, 14 May 2018 22:52:18 +0000 (00:52 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 15 May 2018 14:15:44 +0000 (14:15 +0000)
commit73b5951391a9c206414b2f460a043374b1383b94
tree8b0af2886a094f04fb7bd2bc80f070fbd068df90
parentdb91ee36514e70512615b3e28d0260cfa9270206
misc/wasm: fix passing large negative integers from JS to Go

This commit addresses a FIXME left in the code of wasm_exec.js to
properly get the upper 32 bit of a JS number to be stored as an
64-bit integer. A bitshift operation is not possible, because in
JavaScript bitshift operations only operate on the lower 32 bits.

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