@ CheckReturnValue private FlowScope caseIn ( Node object , String propertyName , FlowScope blindScope ) { JSType jsType = object . getJSType ( ) ; jsType = this . getRestrictedWithoutNull ( jsType ) ; jsType = this . getRestrictedWithoutUndefined ( jsType ) ; boolean hasProperty = false ; ObjectType objectType = ObjectType . cast ( jsType ) ; if ( objectType != null ) { hasProperty = objectType . hasProperty ( propertyName ) ; } if ( ! hasProperty ) { String qualifiedName = object . getQualifiedName ( ) ; if ( qualifiedName != null ) { String propertyQualifiedName = qualifiedName + "." + propertyName ; if ( blindScope . getSlot ( propertyQualifiedName ) == null ) { JSType unknownType = typeRegistry . getNativeType ( JSTypeNative . UNKNOWN_TYPE ) ; return blindScope . inferQualifiedSlot ( object , propertyQualifiedName , unknownType , unknownType , false ) ; } } } return blindScope ; }
Given property in object ensures that the object has the property in the informed scope by defining it as a qualified name if the object type lacks the property and it s not in the blind scope .