From d956c309bb4d07a4573bbbf1643021240dc0ee8e Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 14 Dec 2023 21:29:40 -0500 Subject: [PATCH] refactor(vats): Delay invocation with `E` rather than `Promise.resolve().then` --- packages/vats/src/core/chain-behaviors.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/vats/src/core/chain-behaviors.js b/packages/vats/src/core/chain-behaviors.js index 08f94d06b33..5babdcd61b3 100644 --- a/packages/vats/src/core/chain-behaviors.js +++ b/packages/vats/src/core/chain-behaviors.js @@ -95,12 +95,9 @@ export const bridgeCoreEval = async allPowers => { await Promise.all( evals.map(coreEval => { // Run in a new turn to avoid crosstalk of the evaluations. - return Promise.resolve() - .then(() => evaluateCoreEval(coreEval)) - .catch(err => { - console.error('CORE_EVAL failed:', err); - throw err; - }); + const evalP = E(evaluateCoreEval)(coreEval); + evalP.catch(err => console.error('CORE_EVAL failed:', err)); + return evalP; }), ); },