execute: Fix some compatibility layer timing bugs (#8)

This commit is contained in:
Thomas Weber committed 2020-08-08 22:43:27 -05:00
1 parent e5b252502f
commit 0447835bc7
1 file changed
+8 -2
+8 -2
View File
@@ -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();
}