/** * Gets the docInfo on the specified property on this type. This should not * be implemented recursively, as you generally need to know exactly on * which type in the prototype chain the JSDocInfo exists. */ public final JSDocInfo getOwnPropertyJSDocInfo(String propertyName) { Property p = getOwnSlot(propertyName); return p == null ? null : p.getJSDocInfo(); }
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); }
public final JSDocInfo getPropertyJSDocInfo(String propertyName) { Property p = getSlot(propertyName); return p == null ? null : p.getJSDocInfo(); }
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); }
/** * Gets the docInfo on the specified property on this type. This should not * be implemented recursively, as you generally need to know exactly on * which type in the prototype chain the JSDocInfo exists. */ public JSDocInfo getOwnPropertyJSDocInfo(String propertyName) { Property p = getOwnSlot(propertyName); return p == null ? null : p.getJSDocInfo(); }
private static ConformanceResult checkCtorProperties(ObjectType type) { for (String propertyName : type.getOwnPropertyNames()) { Property prop = type.getOwnSlot(propertyName); JSDocInfo docInfo = prop.getJSDocInfo(); Node scriptNode = getScriptNode(prop.getNode()); ConformanceResult result = visibilityAtDeclarationOrFileoverview( docInfo, scriptNode); if (result != ConformanceResult.CONFORMANCE) { return result; } } return ConformanceResult.CONFORMANCE; }
private boolean isDeclaredUnknown(Node n) { Node target = n.getFirstChild(); ObjectType targetType = target.getJSType().toObjectType(); if (targetType != null) { Property prop = targetType.getSlot(n.getLastChild().getString()); if (prop != null) { JSDocInfo info = prop.getJSDocInfo(); if (info != null && info.hasType()) { JSTypeExpression expr = info.getType(); Node typeExprNode = expr.getRoot(); if (typeExprNode.getType() == Token.QMARK && !typeExprNode.hasChildren()) { return true; } } } } return false; } }
isClassType = p.getJSDocInfo().isConstructor(); } else if (isPrivateByConvention) {