diff options
Diffstat (limited to 'core/core.js')
-rw-r--r-- | core/core.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/core.js b/core/core.js index a96ce81d7..bda6739a2 100644 --- a/core/core.js +++ b/core/core.js @@ -155,12 +155,7 @@ SharedQueue Binary Layout asyncHandlers[opId] = cb; } - function handleAsyncMsgFromRust(opId, buf) { - if (buf) { - // This is the overflow_response case of deno::JsRuntime::poll(). - asyncHandlers[opId](buf); - return; - } + function handleAsyncMsgFromRust() { while (true) { const opIdBuf = shift(); if (opIdBuf == null) { @@ -169,6 +164,10 @@ SharedQueue Binary Layout assert(asyncHandlers[opIdBuf[0]] != null); asyncHandlers[opIdBuf[0]](opIdBuf[1]); } + + for (let i = 0; i < arguments.length; i += 2) { + asyncHandlers[arguments[i]](arguments[i + 1]); + } } function dispatch(opName, control, ...zeroCopy) { |