mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
targets/wasm_exec: add runtime.getRandomData to gojs imports
This commit is contained in:
@@ -294,6 +294,11 @@
|
||||
return BigInt((timeOrigin + performance.now()) * 1e6);
|
||||
},
|
||||
|
||||
// func getRandomData(r []byte)
|
||||
"runtime.getRandomData": (slice_ptr, slice_len, slice_cap) => {
|
||||
crypto.getRandomValues(loadSlice(slice_ptr, slice_len, slice_cap));
|
||||
},
|
||||
|
||||
// func sleepTicks(timeout int64)
|
||||
"runtime.sleepTicks": (timeout) => {
|
||||
// Do not sleep, only reactivate scheduler after the given timeout.
|
||||
|
||||
Reference in New Issue
Block a user