(message)
| 259 | |
| 260 | /* Push a string into the VM's event queue; wakes `receive()`. Buffers if the VM isn't paused on PENDING_EVENT yet, the driver loop drains the buffer at the next yield, so callers never need to know about the VM's readiness window. */ |
| 261 | export function pushEvent(message) { |
| 262 | const msg = String(message); |
| 263 | if (!injectEvent(msg)) { |
| 264 | pendingEvents.push(msg); |
| 265 | return true; |
| 266 | } |
| 267 | if (eventWaiter) { |
| 268 | const w = eventWaiter; |
| 269 | eventWaiter = null; |
| 270 | w(); |
| 271 | } |
| 272 | return true; |
| 273 | } |
| 274 | |
| 275 | /* Register the host-call delegate. worker.js wires a postMessage round-trip; no other consumer is supported. */ |
| 276 | export function setHostCallDelegate(fn) { |
nothing calls this directly
no test coverage detected