@Nullable
  private static Node getSubclassForEs6Superclass(Node superclass) {
    Node classNode = superclass.getParent();
    checkArgument(classNode.isClass(), classNode);
    if (NodeUtil.isNameDeclaration(classNode.getGrandparent())) {
      // const Clazz = class extends Super {
      return classNode.getParent();
    } else if (superclass.getGrandparent().isAssign()) {
      // ns.foo.Clazz = class extends Super {
      return classNode.getPrevious();
    } else if (NodeUtil.isClassDeclaration(classNode)) {
      // class Clazz extends Super {
      return classNode.getFirstChild();
    }
    return null;
  }
@ Nullable private static Node getSubclassForEs6Superclass ( Node superclass ) { Node classNode = superclass . getParent ( ) ; checkArgument ( classNode . isClass ( ) , classNode ) ; if ( NodeUtil . isNameDeclaration ( classNode . getGrandparent ( ) ) ) { return classNode . getParent ( ) ; } else if ( superclass . getGrandparent ( ) . isAssign ( ) ) { return classNode . getPrevious ( ) ; } else if ( NodeUtil . isClassDeclaration ( classNode ) ) { return classNode . getFirstChild ( ) ; } return null ; }
Tries to find an lvalue for the subclass given the superclass node in an `class ... extends `
clause

<p>Only handles cases where we have either a class declaration or a class expression in an
assignment or name declaration. Otherwise returns null.