mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +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);
|
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)
|
// func sleepTicks(timeout int64)
|
||||||
"runtime.sleepTicks": (timeout) => {
|
"runtime.sleepTicks": (timeout) => {
|
||||||
// Do not sleep, only reactivate scheduler after the given timeout.
|
// Do not sleep, only reactivate scheduler after the given timeout.
|
||||||
|
|||||||
Reference in New Issue
Block a user