public final boolean defineInferredProperty ( String propertyName , JSType type , Node propertyNode ) { if ( hasProperty ( propertyName ) ) { if ( isPropertyTypeDeclared ( propertyName ) ) { // We never want to hide a declared property with an inferred property. return true ; } JSType originalType = getPropertyType ( propertyName ) ; type = originalType == null ? type : originalType . getLeastSupertype ( type ) ; } boolean result = defineProperty ( propertyName , type , true , propertyNode ) ; // All property definitions go through this method // or defineDeclaredProperty. Because the properties defined an an // object can affect subtyping, it's slightly more efficient // to register this after defining the property. registry . registerPropertyOnType ( propertyName , this ) ; return result ; }
Defines a property whose type is inferred .