code: @Nullable
    private static Node primaryAccessControlScopeRootFor(Node node) {
      if (isExtendsTarget(node)) {
        return node.getParent();
      } else if (isFunctionOrClass(node)) {
        return node;
      } else {
        return null;
      }
    }
docs: Maps {@code node} to the <em>primary</em> root of an access-control scope if it is some root,
  or {@code null} if it is a non-root of the scope.
  
  <p>We define access-control scopes differently from {@code Scope}s because of mismatches
  between ECMAScript scoping and our AST structure (e.g. the `extends` clause of a CLASS). {@link
  NodeTraveral} is designed to walk the AST in ECMAScript scope order, which is not the pre-order
  traversal that we would prefer here. This requires us to treat access-control scopes as a
  forest with a primary root.
  
  <p>Each access-control scope corresponds to some "owner" JavaScript type which is used when
  computing access-controls. At this time, each also corresponds to an AST subtree.
  
  <p>Known mismatches:
  
  <ul>
  <li>CLASS extends clause: secondary root of the scope defined by the CLASS.
  </ul>