Rewrite with working async

This commit is contained in:
2026-10-16 08:00:06 +00:00
parent d0c2f291e9
commit 1e4647347f
36 changed files with 5106 additions and 654 deletions
+2 -3
View File
@@ -32,12 +32,11 @@ function __drain_microtasks() {
q.head = 0;
}
// What the host calls when op `h` is done: its callback, then the microtasks
// What the host calls when op `h` is done: its callback, then the microtasks.
// The compiler finds it by name
function __complete(h) {
const done = __pending[h];
__pending[h] = undefined;
if (done !== undefined) done(h);
__drain_microtasks();
}
__link_host_complete(__complete);