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

Unified Diff: pkg/analyzer_experimental/lib/src/generated/ast.dart

Issue 14205011: Issue 9845. Compare runtime types using ==. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: pkg/analyzer_experimental/lib/src/generated/ast.dart
diff --git a/pkg/analyzer_experimental/lib/src/generated/ast.dart b/pkg/analyzer_experimental/lib/src/generated/ast.dart
index 6ee213c6535daabba26521691aea2f86e2b8f7c1..cd99c9e2c22bfd9a5b878c5dfd0996a138ccac03 100644
--- a/pkg/analyzer_experimental/lib/src/generated/ast.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/ast.dart
@@ -11716,6 +11716,14 @@ class NodeLocator extends GeneralizingASTVisitor<Object> {
return _foundNode;
}
Object visitNode(ASTNode node) {
+ int start = node.offset;
+ int end = start + node.length;
+ if (end < _startOffset) {
+ return null;
+ }
+ if (start > _endOffset) {
+ return null;
+ }
try {
node.visitChildren(this);
} on NodeLocator_NodeFoundException catch (exception) {
@@ -11723,8 +11731,6 @@ class NodeLocator extends GeneralizingASTVisitor<Object> {
} catch (exception) {
AnalysisEngine.instance.logger.logInformation2("Exception caught while traversing an AST structure.", exception);
}
- int start = node.offset;
- int end = start + node.length;
if (start <= _startOffset && _endOffset <= end) {
_foundNode = node;
throw new NodeLocator_NodeFoundException();

Powered by Google App Engine
This is Rietveld 408576698