summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorRichard Musiol <mail@richard-musiol.de>2018-03-04 12:16:18 +0100
committerBrad Fitzpatrick <bradfitz@golang.org>2018-06-01 05:18:38 +0000
commit063f97a6110079c2aaeb5f2c2a51d7f1bc7445ab (patch)
tree1d47e463e065280a53539ce838a9c97b271a3b31 /misc
parenta7e0a920ad45482183783c56e4dd39c9457ff4cc (diff)
downloadgo-git-063f97a6110079c2aaeb5f2c2a51d7f1bc7445ab.tar.gz
os: add js/wasm architecture
This commit adds the js/wasm architecture to the os package. Access to the actual file system is supported through Node.js. Updates #18892 Change-Id: I6fa642fb294ca020b2c545649d4324d981aa0408 Reviewed-on: https://go-review.googlesource.com/109977 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/wasm/wasm_exec.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js
index 142080bf55..e579ecf677 100755
--- a/misc/wasm/wasm_exec.js
+++ b/misc/wasm/wasm_exec.js
@@ -143,6 +143,11 @@
mem().setInt32(sp + 16, (msec % 1000) * 1000000, true);
},
+ // func getRandomData(r []byte)
+ "runtime.getRandomData": (sp) => {
+ crypto.getRandomValues(loadSlice(sp + 8));
+ },
+
// func boolVal(value bool) Value
"syscall/js.boolVal": (sp) => {
storeValue(sp + 16, mem().getUint8(sp + 8) !== 0);