function getScopeNode(node) {
	for (
		let currentNode = node;
		currentNode;
		currentNode = currentNode.parent
	) {
		if (SCOPE_NODE_TYPE.test(currentNode.type)) {
			return currentNode;
		}
	}

	/* c8 ignore next */
	return null;
}
Gets the scope node which directly contains a given node.
@param {ASTNode} node A node to get. This is a `VariableDeclaration` or
     an `Identifier`.
@returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`,
     `SwitchStatement`, `ForStatement`, `ForInStatement`, and
     `ForOfStatement`.