lib/rules/no-await-in-loop.js
function validate(awaitNode) {
            if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
                return;
            }

            let node = awaitNode;
            let parent = node.parent;

            while (parent && !isBoundary(parent)) {
                if (isLooped(node, parent)) {
                    context.report({
                        node: awaitNode,
                        messageId: "unexpectedAwait"
                    });
                    return;
                }
                node = parent;
                parent = parent.parent;
            }
        }
function validate(awaitNode) {
            if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
                return;
            }

            let node = awaitNode;
            let parent = node.parent;

            while (parent && !isBoundary(parent)) {
                if (isLooped(node, parent)) {
                    context.report({
                        node: awaitNode,
                        messageId: "unexpectedAwait"
                    });
                    return;
                }
                node = parent;
                parent = parent.parent;
            }
        }
function validate ( awaitNode ) { if ( awaitNode . type === "ForOfStatement" && ! awaitNode . await ) { return ; } let node = awaitNode ; let parent = node . parent ; while ( parent && ! isBoundary ( parent ) ) { if ( isLooped ( node , parent ) ) { context . report ( { node : awaitNode , messageId : "unexpectedAwait" } ) ; return ; } node = parent ; parent = parent . parent ; } }
Validate an await expression.
@param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate.
@returns {void}
Validate an await expression .