| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 List<InterfaceType> get allSupertypes { | 159 List<InterfaceType> get allSupertypes { |
| 160 List<InterfaceType> list = new List<InterfaceType>(); | 160 List<InterfaceType> list = new List<InterfaceType>(); |
| 161 _collectAllSupertypes(list); | 161 _collectAllSupertypes(list); |
| 162 return list; | 162 return list; |
| 163 } | 163 } |
| 164 | 164 |
| 165 @override | 165 @override |
| 166 List<ConstructorElement> get constructors { | 166 List<ConstructorElement> get constructors { |
| 167 if (!isMixinApplication) { | 167 if (!isMixinApplication) { |
| 168 assert(_constructors != null); | 168 assert(_constructors != null); |
| 169 return _constructors == null | 169 return _constructors ?? ConstructorElement.EMPTY_LIST; |
| 170 ? ConstructorElement.EMPTY_LIST | |
| 171 : _constructors; | |
| 172 } | 170 } |
| 173 | |
| 174 return _computeMixinAppConstructors(); | 171 return _computeMixinAppConstructors(); |
| 175 } | 172 } |
| 176 | 173 |
| 177 /** | 174 /** |
| 178 * Set the constructors contained in this class to the given [constructors]. | 175 * Set the constructors contained in this class to the given [constructors]. |
| 179 * | 176 * |
| 180 * Should only be used for class elements that are not mixin applications. | 177 * Should only be used for class elements that are not mixin applications. |
| 181 */ | 178 */ |
| 182 void set constructors(List<ConstructorElement> constructors) { | 179 void set constructors(List<ConstructorElement> constructors) { |
| 183 assert(!isMixinApplication); | 180 assert(!isMixinApplication); |
| (...skipping 4856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5040 | 5037 |
| 5041 @override | 5038 @override |
| 5042 void visitElement(Element element) { | 5039 void visitElement(Element element) { |
| 5043 int offset = element.nameOffset; | 5040 int offset = element.nameOffset; |
| 5044 if (offset != -1) { | 5041 if (offset != -1) { |
| 5045 map[offset] = element; | 5042 map[offset] = element; |
| 5046 } | 5043 } |
| 5047 super.visitElement(element); | 5044 super.visitElement(element); |
| 5048 } | 5045 } |
| 5049 } | 5046 } |
| OLD | NEW |