function isInsideClassBody(node) {
  let parent = node.parent;
  while (parent) {
    if (parent.type === 'ClassBody') {
      return true;
    }
    parent = parent.parent;
  }
  return false;
}
Checks if a node is inside a class body.

@param {ASTNode} node the AST node being checked.
@returns {boolean} True if the node has a ClassBody ancestor, false if not.