OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1044 } |
1045 } | 1045 } |
1046 return true; | 1046 return true; |
1047 } | 1047 } |
1048 | 1048 |
1049 @override | 1049 @override |
1050 void visitChildren(ElementVisitor visitor) { | 1050 void visitChildren(ElementVisitor visitor) { |
1051 super.visitChildren(visitor); | 1051 super.visitChildren(visitor); |
1052 safelyVisitChildren(_constructors, visitor); | 1052 safelyVisitChildren(_constructors, visitor); |
1053 safelyVisitChildren(methods, visitor); | 1053 safelyVisitChildren(methods, visitor); |
1054 safelyVisitChildren(_typeParameters, visitor); | 1054 safelyVisitChildren(typeParameters, visitor); |
1055 } | 1055 } |
1056 | 1056 |
1057 void _collectAllSupertypes(List<InterfaceType> supertypes) { | 1057 void _collectAllSupertypes(List<InterfaceType> supertypes) { |
1058 List<InterfaceType> typesToVisit = new List<InterfaceType>(); | 1058 List<InterfaceType> typesToVisit = new List<InterfaceType>(); |
1059 List<ClassElement> visitedClasses = new List<ClassElement>(); | 1059 List<ClassElement> visitedClasses = new List<ClassElement>(); |
1060 typesToVisit.add(this.type); | 1060 typesToVisit.add(this.type); |
1061 while (!typesToVisit.isEmpty) { | 1061 while (!typesToVisit.isEmpty) { |
1062 InterfaceType currentType = typesToVisit.removeAt(0); | 1062 InterfaceType currentType = typesToVisit.removeAt(0); |
1063 ClassElement currentElement = currentType.element; | 1063 ClassElement currentElement = currentType.element; |
1064 if (!visitedClasses.contains(currentElement)) { | 1064 if (!visitedClasses.contains(currentElement)) { |
(...skipping 7422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8487 | 8487 |
8488 @override | 8488 @override |
8489 void visitElement(Element element) { | 8489 void visitElement(Element element) { |
8490 int offset = element.nameOffset; | 8490 int offset = element.nameOffset; |
8491 if (offset != -1) { | 8491 if (offset != -1) { |
8492 map[offset] = element; | 8492 map[offset] = element; |
8493 } | 8493 } |
8494 super.visitElement(element); | 8494 super.visitElement(element); |
8495 } | 8495 } |
8496 } | 8496 } |
OLD | NEW |