| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Mixins that implement convenience methods on [Element] subclasses. | 5 /// Mixins that implement convenience methods on [Element] subclasses. |
| 6 | 6 |
| 7 library elements.common; | 7 library elements.common; |
| 8 | 8 |
| 9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
| 10 Names; | 10 Names, |
| 11 Uris; |
| 11 import '../compiler.dart' show | 12 import '../compiler.dart' show |
| 12 Compiler, | 13 Compiler, |
| 13 isPrivateName; | 14 isPrivateName; |
| 14 import '../dart_types.dart' show | 15 import '../dart_types.dart' show |
| 15 DartType, | 16 DartType, |
| 16 InterfaceType, | 17 InterfaceType, |
| 17 FunctionType; | 18 FunctionType; |
| 18 import '../util/util.dart' show | 19 import '../util/util.dart' show |
| 19 Link; | 20 Link; |
| 20 | 21 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 117 } |
| 117 | 118 |
| 118 @override | 119 @override |
| 119 Element get origin { | 120 Element get origin { |
| 120 throw new UnsupportedError('origin is not supported on $this'); | 121 throw new UnsupportedError('origin is not supported on $this'); |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 | 124 |
| 124 abstract class LibraryElementCommon implements LibraryElement { | 125 abstract class LibraryElementCommon implements LibraryElement { |
| 125 @override | 126 @override |
| 126 bool get isDartCore => canonicalUri == Compiler.DART_CORE; | 127 bool get isDartCore => canonicalUri == Uris.dart_core; |
| 127 | 128 |
| 128 @override | 129 @override |
| 129 bool get isPlatformLibrary => canonicalUri.scheme == 'dart'; | 130 bool get isPlatformLibrary => canonicalUri.scheme == 'dart'; |
| 130 | 131 |
| 131 @override | 132 @override |
| 132 bool get isPackageLibrary => canonicalUri.scheme == 'package'; | 133 bool get isPackageLibrary => canonicalUri.scheme == 'package'; |
| 133 | 134 |
| 134 @override | 135 @override |
| 135 bool get isInternalLibrary => | 136 bool get isInternalLibrary => |
| 136 isPlatformLibrary && canonicalUri.path.startsWith('_'); | 137 isPlatformLibrary && canonicalUri.path.startsWith('_'); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 // this signature must not have more required parameters. Having more | 493 // this signature must not have more required parameters. Having more |
| 493 // optional parameters is not a problem, they simply are never provided | 494 // optional parameters is not a problem, they simply are never provided |
| 494 // by call sites of a call to a method with the other signature. | 495 // by call sites of a call to a method with the other signature. |
| 495 int otherTotalCount = signature.parameterCount; | 496 int otherTotalCount = signature.parameterCount; |
| 496 return requiredParameterCount <= otherTotalCount | 497 return requiredParameterCount <= otherTotalCount |
| 497 && parameterCount >= otherTotalCount; | 498 && parameterCount >= otherTotalCount; |
| 498 } | 499 } |
| 499 return true; | 500 return true; |
| 500 } | 501 } |
| 501 } | 502 } |
| OLD | NEW |