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

Unified Diff: pkg/dartino_compiler/lib/src/find_position_visitor.dart

Issue 2140053002: Handle functions with no attached node in find_position_visitor. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartino_compiler/lib/src/find_position_visitor.dart
diff --git a/pkg/dartino_compiler/lib/src/find_position_visitor.dart b/pkg/dartino_compiler/lib/src/find_position_visitor.dart
index 72e62ca43cd7496f4a09842ac40bcb0cd7590827..d1656a12b4267376ea432959d4a631bf1bb5975d 100644
--- a/pkg/dartino_compiler/lib/src/find_position_visitor.dart
+++ b/pkg/dartino_compiler/lib/src/find_position_visitor.dart
@@ -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;
danrubel 2016/07/12 14:15:06 Should we log something here to obtain more inform
sigurdm 2016/08/10 09:05:11 I prefer that we replicate it locally and fix it.
return node.getBeginToken().charOffset <= position &&
position < node.getEndToken().charEnd;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698