function getContainingLoopNode(node){var parent=node.parent;while(parent){switch(parent.type){case"WhileStatement":case"DoWhileStatement":return parent;case"ForStatement":// `init` is outside of the loop.
if(parent.init!==node){return parent;}break;case"ForInStatement":case"ForOfStatement":// `right` is outside of the loop.
if(parent.right!==node){return parent;}break;case"ArrowFunctionExpression":case"FunctionExpression":case"FunctionDeclaration":// We don't need to check nested functions.
return null;default:break;}node=parent;parent=node.parent;}return null;}
Gets the containing loop node of a specified node.

We don't need to check nested functions, so this ignores those.
`Scope.through` contains references of nested functions.

@param {ASTNode} node - An AST node to get.
@returns {ASTNode|null} The containing loop node of the specified node, or
     `null`.