Index: Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ProtoFollowsExtendsChecker.java |
diff --git a/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ProtoFollowsExtendsChecker.java b/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ProtoFollowsExtendsChecker.java |
index 8a7d86d713481c800ee610249518a94ba59f5656..23090aba4d04d8db80abaf2b3f1a3203bea54bc1 100644 |
--- a/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ProtoFollowsExtendsChecker.java |
+++ b/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ProtoFollowsExtendsChecker.java |
@@ -161,23 +161,29 @@ public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker { |
} |
typesWithAssignedProto.add(currentType); |
String value = state.getNodeText(node.getRight()); |
- if (!AstUtil.isPrototypeName(value)) { |
+ boolean isNullPrototype = "null".equals(value); |
+ if (!isNullPrototype && !AstUtil.isPrototypeName(value)) { |
reportErrorAtNodeStart( |
node.getRight(), "__proto__ value is not a prototype"); |
return; |
} |
- String superType = AstUtil.getTypeNameFromPrototype(value); |
+ String superType = isNullPrototype ? "null" : AstUtil.getTypeNameFromPrototype(value); |
if (type.isInterface) { |
reportErrorAtNodeStart(node.getLeft(), String.format( |
"__proto__ defined for interface %s", type.typeName)); |
return; |
} else { |
- if (type.extendedTypes.isEmpty()) { |
+ if (!isNullPrototype && type.extendedTypes.isEmpty()) { |
reportErrorAtNodeStart(node.getRight(), String.format( |
"No @extends annotation for %s extending %s", type.typeName, superType)); |
return; |
} |
} |
+ |
+ if (isNullPrototype) { |
+ return; |
+ } |
+ |
// FIXME: Should we check that there is only one @extend-ed type |
// for the non-interface |type|? Closure is supposed to do this anyway... |
InheritanceEntry entry = type.getFirstExtendedType(); |