2018-10-30 18:53:05 +03:00
|
|
|
// +build js,wasm
|
|
|
|
|
|
|
|
package qt
|
|
|
|
|
2018-11-06 20:16:33 +03:00
|
|
|
import (
|
|
|
|
"syscall/js"
|
|
|
|
"unsafe"
|
|
|
|
)
|
2018-10-30 18:53:05 +03:00
|
|
|
|
2018-11-06 20:16:33 +03:00
|
|
|
func init() {
|
2019-09-10 21:17:30 +03:00
|
|
|
Module.Set("_callbackReleaseTypedArray", js.FuncOf(func(_ js.Value, args []js.Value) interface{} {
|
|
|
|
ReleaseTypedArray(unsafe.Pointer(uintptr(args[0].Int())))
|
2018-11-06 20:16:33 +03:00
|
|
|
return nil
|
|
|
|
}))
|
|
|
|
}
|
2018-11-17 04:47:23 +03:00
|
|
|
|
|
|
|
var Global = js.Global()
|
|
|
|
var Module = Global.Call("eval", "Module")
|
|
|
|
|
|
|
|
//TODO: func MakeWrapper(i interface{}) *js.Value
|