code: function getContainingLoopNode(node) {
      for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) {
          const parent = currentNode.parent;
  
          switch (parent.type) {
              case "WhileStatement":
              case "DoWhileStatement":
                  return parent;
  
              case "ForStatement":
  
                  // `init` is outside of the loop.
                  if (parent.init !== currentNode) {
                      return parent;
                  }
                  break;
  
              case "ForInStatement":
              case "ForOfStatement":
  
                  // `right` is outside of the loop.
                  if (parent.right !== currentNode) {
                      return parent;
                  }
                  break;
  
              case "ArrowFunctionExpression":
              case "FunctionExpression":
              case "FunctionDeclaration":
  
                  // We don't need to check nested functions.
                  return null;
  
              default:
                  break;
          }
      }
  
      return null;
  }
docs: ------------------------------------------------------------------------------ Helpers ------------------------------------------------------------------------------ 
  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`.