async function evaluateAwaitExpression({ node, environment, evaluate, policy, statementTraversalStack }) {
    // If a maximum duration for any operation is given, set a timeout that will throw a PolicyError when and if the duration is exceeded.
    const timeout = policy.maxOpDuration === Infinity
        ? undefined
        : setTimeout(() => {
            throw new MaxOpDurationExceededError({ duration: policy.maxOpDuration, node });
        }, policy.maxOpDuration);
    const result = evaluate.expression(node.expression, environment, statementTraversalStack);
    // Make sure to clear the timeout if it exists to avoid throwing unnecessarily
    if (timeout != null)
        clearTimeout(timeout);
    // Return the evaluated result
    return result;
}
/**
 * Evaluates, or attempts to evaluate, an AwaitExpression
 */
Evaluates, or attempts to evaluate, an AwaitExpression
Evaluates or attempts to evaluate an AwaitExpression
async function evaluateAwaitExpression({ node, environment, evaluate, policy, statementTraversalStack }) {
    const timeout = policy.maxOpDuration === Infinity
        ? undefined
        : setTimeout(() => {
            throw new MaxOpDurationExceededError({ duration: policy.maxOpDuration, node });
        }, policy.maxOpDuration);
    const result = evaluate.expression(node.expression, environment, statementTraversalStack);
    if (timeout != null)
        clearTimeout(timeout);
    return result;
}
async function evaluateAwaitExpression ( { node , environment , evaluate , policy , statementTraversalStack } ) { const timeout = policy . maxOpDuration === Infinity ? undefined : setTimeout ( ( ) => { throw new MaxOpDurationExceededError ( { duration : policy . maxOpDuration , node } ) ; } , policy . maxOpDuration ) ; const result = evaluate . expression ( node . expression , environment , statementTraversalStack ) ; if ( timeout != null ) clearTimeout ( timeout ) ; return result ; }
Evaluates, or attempts to evaluate, an AwaitExpression
Evaluates or attempts to evaluate an AwaitExpression
// If a maximum duration for any operation is given, set a timeout that will throw a PolicyError when and if the duration is exceeded. // Make sure to clear the timeout if it exists to avoid throwing unnecessarily // Return the evaluated result