diff --git a/app/astride/sandbox.js b/app/astride/sandbox.js index 2c8a9cd..1f4ca19 100644 --- a/app/astride/sandbox.js +++ b/app/astride/sandbox.js @@ -704,7 +704,10 @@ export default class Sandbox { switch (result.yield) { case YIELD_PROMISE: { stepResult.async = true; - stepResult.value = Promise.resolve(result.value) + const promise = result.value instanceof Promise + ? result.value + : Promise.resolve(result.value); + promise .then((value) => { const top = this.$$execution.stack[this.$$execution.stack.length - 1]; this.$$execution.deferred.set(top, { @@ -712,6 +715,7 @@ export default class Sandbox { yield: YIELD_NONE, }); }); + stepResult.value = promise; break; } case YIELD_LOOP_UPDATE: {