]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/lock_js.go
all: implement wasmimport directive
[gostls13.git] / src / runtime / lock_js.go
index f71e7a2b4a59cddcc36999761b2170e98329fe9d..f87a94a8490fca8c6d00d39c8ce9e7ffcf612f17 100644 (file)
@@ -6,9 +6,7 @@
 
 package runtime
 
-import (
-       _ "unsafe"
-)
+import _ "unsafe" // for go:linkname
 
 // js/wasm has no support for threads yet. There is no preemption.
 
@@ -232,9 +230,13 @@ func pause(newsp uintptr)
 
 // scheduleTimeoutEvent tells the WebAssembly environment to trigger an event after ms milliseconds.
 // It returns a timer id that can be used with clearTimeoutEvent.
+//
+//go:wasmimport gojs runtime.scheduleTimeoutEvent
 func scheduleTimeoutEvent(ms int64) int32
 
 // clearTimeoutEvent clears a timeout event scheduled by scheduleTimeoutEvent.
+//
+//go:wasmimport gojs runtime.clearTimeoutEvent
 func clearTimeoutEvent(id int32)
 
 // handleEvent gets invoked on a call from JavaScript into Go. It calls the event handler of the syscall/js package