Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Handle functions with no attached node in find_position_visitor.
Browse files Browse the repository at this point in the history
This fixes issue #582.

R=danrubel@google.com

Review URL: https://codereview.chromium.org/2140053002 .
  • Loading branch information
sigurdm committed Aug 10, 2016
1 parent f747120 commit dc80f5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/dartino_compiler/lib/src/find_position_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class FindFunctionAtPositionVisitor extends BaseElementVisitor {
visitElement(Element element, _) {}

bool containsPosition(Node node) {
// TODO(sigurdm): Find out when [node] is null.
if (node == null) return false;
return node.getBeginToken().charOffset <= position &&
position < node.getEndToken().charEnd;
}
Expand Down

0 comments on commit dc80f5b

Please sign in to comment.