Rewrite with working async
This commit is contained in:
+2
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user