| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 /// Helpers for Analyzer's Element model and corelib model. | 7 /// Helpers for Analyzer's Element model and corelib model. |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart' | 9 import 'package:analyzer/dart/ast/ast.dart' |
| 10 show | 10 show |
| 11 ConstructorDeclaration, | 11 ConstructorDeclaration, |
| 12 Expression, | 12 Expression, |
| 13 FunctionBody, | 13 FunctionBody, |
| 14 FunctionExpression, | 14 FunctionExpression, |
| 15 MethodDeclaration, | 15 MethodDeclaration, |
| 16 MethodInvocation, | 16 MethodInvocation, |
| 17 SimpleIdentifier; | 17 SimpleIdentifier; |
| 18 import 'package:analyzer/dart/element/element.dart' | 18 import 'package:analyzer/dart/element/element.dart' |
| 19 show ClassElement, Element, ExecutableElement, FunctionElement; | 19 show |
| 20 ClassElement, |
| 21 Element, |
| 22 ExecutableElement, |
| 23 FunctionElement, |
| 24 LibraryElement; |
| 20 import 'package:analyzer/dart/element/type.dart' | 25 import 'package:analyzer/dart/element/type.dart' |
| 21 show DartType, InterfaceType, ParameterizedType; | 26 show DartType, InterfaceType, ParameterizedType; |
| 22 import 'package:analyzer/src/dart/element/type.dart' show DynamicTypeImpl; | 27 import 'package:analyzer/src/dart/element/type.dart' show DynamicTypeImpl; |
| 23 import 'package:analyzer/src/generated/constant.dart' | 28 import 'package:analyzer/src/generated/constant.dart' |
| 24 show DartObject, DartObjectImpl; | 29 show DartObject, DartObjectImpl; |
| 25 | 30 |
| 26 class Tuple2<T0, T1> { | 31 class Tuple2<T0, T1> { |
| 27 final T0 e0; | 32 final T0 e0; |
| 28 final T1 e1; | 33 final T1 e1; |
| 29 Tuple2(this.e0, this.e1); | 34 Tuple2(this.e0, this.e1); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 if (mixin != null) result.add(mixin); | 137 if (mixin != null) result.add(mixin); |
| 133 } | 138 } |
| 134 var supertype = cls.supertype; | 139 var supertype = cls.supertype; |
| 135 if (supertype == null) break; | 140 if (supertype == null) break; |
| 136 | 141 |
| 137 cls = supertype.element; | 142 cls = supertype.element; |
| 138 result.add(cls); | 143 result.add(cls); |
| 139 } | 144 } |
| 140 return result; | 145 return result; |
| 141 } | 146 } |
| 147 |
| 148 List<ClassElement> getImmediateSuperclasses(ClassElement c) { |
| 149 var result = <ClassElement>[]; |
| 150 for (var m in c.mixins.reversed) { |
| 151 result.add(m.element); |
| 152 } |
| 153 var s = c.supertype; |
| 154 if (s != null) result.add(s.element); |
| 155 return result; |
| 156 } |
| 157 |
| 158 bool isSdkInternalRuntime(LibraryElement l) => |
| 159 l.isInSdk && l.source.uri.toString() == 'dart:_runtime'; |
| OLD | NEW |