private void checkCallConventions ( NodeTraversal t , Node n ) { SubclassRelationship relationship = compiler . getCodingConvention ( ) . getClassesDefinedByCall ( n ) ; TypedScope scope = t . getTypedScope ( ) ; if ( relationship != null ) { ObjectType superClass = TypeValidator . getInstanceOfCtor ( scope . lookupQualifiedName ( QualifiedName . of ( relationship . superclassName ) ) ) ; ObjectType subClass = TypeValidator . getInstanceOfCtor ( scope . lookupQualifiedName ( QualifiedName . of ( relationship . subclassName ) ) ) ; if ( relationship . type == SubclassType . INHERITS && superClass != null && ! superClass . isEmptyType ( ) && subClass != null && ! subClass . isEmptyType ( ) ) { validator . expectSuperType ( n , superClass , subClass ) ; } } }
Validate class - defining calls . Because JS has no native syntax for defining classes we need to do this manually .