src/com/google/javascript/jscomp/TypeCheck.java
/**
   * Validate class-defining calls.
   * Because JS has no 'native' syntax for defining classes, we need
   * to do this manually.
   */
Validate class-defining calls.
Because JS has no 'native' syntax for defining classes, we need
to do this manually.
Validate class - defining calls . Because JS has no ' native ' syntax for defining classes we need to do this manually .
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.getVar(relationship.superclassName));
      ObjectType subClass = TypeValidator.getInstanceOfCtor(
          scope.getVar(relationship.subclassName));
      if (relationship.type == SubclassType.INHERITS
          && superClass != null
          && !superClass.isEmptyType()
          && subClass != null
          && !subClass.isEmptyType()) {
        validator.expectSuperType(t, n, superClass, subClass);
      }
    }
  }
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 . getVar ( relationship . superclassName ) ) ; ObjectType subClass = TypeValidator . getInstanceOfCtor ( scope . getVar ( relationship . subclassName ) ) ; if ( relationship . type == SubclassType . INHERITS && superClass != null && ! superClass . isEmptyType ( ) && subClass != null && ! subClass . isEmptyType ( ) ) { validator . expectSuperType ( t , n , superClass , subClass ) ; } } }
Validate class-defining calls.
Validate class - defining calls .