(s []float32)
| 209 | } |
| 210 | |
| 211 | func float32SliceToTypedArray(s []float32) js.Value { |
| 212 | bs := unsafe.Slice((*byte)(unsafe.Pointer(&s[0])), len(s)*4) |
| 213 | a := js.Global().Get("Uint8Array").New(len(bs)) |
| 214 | js.CopyBytesToJS(a, bs) |
| 215 | runtime.KeepAlive(s) |
| 216 | buf := a.Get("buffer") |
| 217 | return js.Global().Get("Float32Array").New(buf, a.Get("byteOffset"), a.Get("byteLength").Int()/4) |
| 218 | } |
| 219 | |
| 220 | func newScriptURL(script string) js.Value { |
| 221 | blob := js.Global().Get("Blob").New([]any{script}, map[string]any{"type": "text/javascript"}) |
no outgoing calls
no test coverage detected
searching dependent graphs…