| Index: Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ReturnAnnotationChecker.java
|
| diff --git a/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ReturnAnnotationChecker.java b/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ReturnAnnotationChecker.java
|
| index 10803aa7320af3caace0abdd0681ff574127c51f..60937784ebb6eff2f4a5ff87b27335331ecd83c2 100644
|
| --- a/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ReturnAnnotationChecker.java
|
| +++ b/Source/devtools/scripts/jsdoc-validator/src/org/chromium/devtools/jsdoc/checks/ReturnAnnotationChecker.java
|
| @@ -30,7 +30,7 @@ public final class ReturnAnnotationChecker extends ContextTrackingChecker {
|
| }
|
|
|
| private void handleReturn(ReturnStatement node) {
|
| - if (node.getReturnValue() == null || AstUtil.hasParentOfType(node, Token.ASSIGN)) {
|
| + if (node.getReturnValue() == null || AstUtil.parentOfType(node, Token.ASSIGN) != null) {
|
| return;
|
| }
|
|
|
| @@ -137,8 +137,9 @@ public final class ReturnAnnotationChecker extends ContextTrackingChecker {
|
| return nameNode;
|
| }
|
|
|
| - if (AstUtil.hasParentOfType(functionNode, Token.COLON)) {
|
| - return ((ObjectProperty) functionNode.getParent()).getLeft();
|
| + ObjectProperty parent = (ObjectProperty) AstUtil.parentOfType(functionNode, Token.COLON);
|
| + if (parent != null) {
|
| + return parent.getLeft();
|
| }
|
| // Do not require annotation for assignment-RHS functions.
|
| return null;
|
|
|