From 0447835bc77a1eb075336eea108012b84ea7fd7c Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Sat, 8 Aug 2020 22:43:27 -0500 Subject: [PATCH] execute: Fix some compatibility layer timing bugs (#8) --- src/compiler/execute.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler/execute.js b/src/compiler/execute.js index a37a98c5..bb140fc3 100644 --- a/src/compiler/execute.js +++ b/src/compiler/execute.js @@ -126,9 +126,15 @@ const executeInCompatibilityLayer = function*(inputs, blockFunction) { } while (thread.status === Thread.STATUS_YIELD || thread.status === Thread.STATUS_YIELD_TICK) { - // TODO: warp mode + // todo: handle warp mode + + if (thread.status === Thread.STATUS_YIELD) { + thread.status = Thread.STATUS_RUNNING; + } + yield; - thread.status = Thread.STATUS_RUNNING; + + // todo: do we have to check if returnValue is a promise at this point? returnValue = executeBlock(); }