Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1526)

Unified Diff: Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ProtoFollowsExtendsChecker.java

Issue 202813004: DevTools: [JsDocValidator] Make sure function receivers agree with @this annotations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address misunderstood comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6fb43a7dcdaff46f52988214d81ce733895b3184..8a7d86d713481c800ee610249518a94ba59f5656 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
@@ -99,7 +99,7 @@ public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker {
if (extendedType == null) {
return;
}
- if (extendedType != null && !IGNORED_SUPER_TYPES.contains(extendedType.superTypeName)) {
+ if (!IGNORED_SUPER_TYPES.contains(extendedType.superTypeName)) {
functionsMissingSuperCall.add(function);
}
}
@@ -113,7 +113,7 @@ public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker {
if (extendedType == null) {
return;
}
- getContext().reportErrorInNode(AstUtil.getFunctionNameNode(function.functionNode), 0,
+ reportErrorAtNodeStart(AstUtil.getFunctionNameNode(function.functionNode),
String.format("Type %s extends %s but does not properly invoke its constructor",
function.name, extendedType.superTypeName));
}
@@ -162,18 +162,18 @@ public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker {
typesWithAssignedProto.add(currentType);
String value = state.getNodeText(node.getRight());
if (!AstUtil.isPrototypeName(value)) {
- state.getContext().reportErrorInNode(
- node.getRight(), 0, "__proto__ value is not a prototype");
+ reportErrorAtNodeStart(
+ node.getRight(), "__proto__ value is not a prototype");
return;
}
String superType = AstUtil.getTypeNameFromPrototype(value);
if (type.isInterface) {
- state.getContext().reportErrorInNode(node.getLeft(), 0, String.format(
+ reportErrorAtNodeStart(node.getLeft(), String.format(
"__proto__ defined for interface %s", type.typeName));
return;
} else {
if (type.extendedTypes.isEmpty()) {
- state.getContext().reportErrorInNode(node.getRight(), 0, String.format(
+ reportErrorAtNodeStart(node.getRight(), String.format(
"No @extends annotation for %s extending %s", type.typeName, superType));
return;
}
@@ -183,7 +183,7 @@ public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker {
InheritanceEntry entry = type.getFirstExtendedType();
String extendedTypeName = entry.superTypeName;
if (!superType.equals(extendedTypeName)) {
- state.getContext().reportErrorInNode(node.getRight(), 0, String.format(
+ reportErrorAtNodeStart(node.getRight(), String.format(
"Supertype does not match %s declared in @extends for %s (line %d)",
extendedTypeName, type.typeName,
state.getContext().getPosition(entry.jsDocNode, entry.offsetInJsDocText).line));
@@ -213,7 +213,7 @@ public final class ProtoFollowsExtendsChecker extends ContextTrackingChecker {
return;
}
if (!type.extendedTypes.isEmpty()) {
- state.getContext().reportErrorInNode(prototypeValueNode, 0, String.format(
+ reportErrorAtNodeStart(prototypeValueNode, String.format(
"@extends found for type %s but its prototype is not an object "
+ "containing __proto__", AstUtil.getTypeNameFromPrototype(assignedTypeName)));
}

Powered by Google App Engine
This is Rietveld 408576698