silphius/app/astride/evaluators/await.js
2024-06-22 08:02:23 -05:00

8 lines
208 B
JavaScript

export default function(node, {evaluate, scope}) {
const {value} = evaluate(node.argument, {scope});
return {
async: true,
value: value instanceof Promise ? value : Promise.resolve(value),
};
}