void putProperty(String name, Property newProp) { Property oldProp = properties.get(name); if (oldProp != null) { // This is to keep previously inferred JsDoc info, e.g., in a // replaceScript scenario. newProp.setJSDocInfo(oldProp.getJSDocInfo()); } properties.put(name, newProp); }
void putProperty(String name, Property newProp) { Property oldProp = properties.get(name); if (oldProp != null) { // This is to keep previously inferred JsDoc info, e.g., in a // replaceScript scenario. newProp.setJSDocInfo(oldProp.getJSDocInfo()); } properties.put(name, newProp); }
@Override public void setPropertyJSDocInfo(String propertyName, JSDocInfo info) { if (info != null) { if (properties.getOwnProperty(propertyName) == null) { // If docInfo was attached, but the type of the property // was not defined anywhere, then we consider this an explicit // declaration of the property. defineInferredProperty(propertyName, getPropertyType(propertyName), null); } // The prototype property is not represented as a normal Property. // We probably don't want to attach any JSDoc to it anyway. Property property = properties.getOwnProperty(propertyName); if (property != null) { property.setJSDocInfo(info); } } }
@Override public void setPropertyJSDocInfo(String propertyName, JSDocInfo info) { if (info != null) { if (properties.getOwnProperty(propertyName) == null) { // If docInfo was attached, but the type of the property // was not defined anywhere, then we consider this an explicit // declaration of the property. defineInferredProperty(propertyName, getPropertyType(propertyName), null); } // The prototype property is not represented as a normal Property. // We probably don't want to attach any JSDoc to it anyway. Property property = properties.getOwnProperty(propertyName); if (property != null) { property.setJSDocInfo(info); } } }