| 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 Identifiers, Names, Uris; | 9 import '../common/names.dart' show Identifiers, Names, Uris; |
| 10 import '../core_types.dart' show CommonElements; | 10 import '../core_types.dart' show CommonElements; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 @override | 167 @override |
| 168 bool get isPlatformLibrary => canonicalUri.scheme == 'dart'; | 168 bool get isPlatformLibrary => canonicalUri.scheme == 'dart'; |
| 169 | 169 |
| 170 @override | 170 @override |
| 171 bool get isPackageLibrary => canonicalUri.scheme == 'package'; | 171 bool get isPackageLibrary => canonicalUri.scheme == 'package'; |
| 172 | 172 |
| 173 @override | 173 @override |
| 174 bool get isInternalLibrary => | 174 bool get isInternalLibrary => |
| 175 isPlatformLibrary && canonicalUri.path.startsWith('_'); | 175 isPlatformLibrary && canonicalUri.path.startsWith('_'); |
| 176 | 176 |
| 177 String get libraryOrScriptName { | 177 String get name { |
| 178 if (hasLibraryName) { | 178 if (hasLibraryName) { |
| 179 return libraryName; | 179 return libraryName; |
| 180 } else { | 180 } else { |
| 181 // Use the file name as script name. | 181 // Use the file name as script name. |
| 182 String path = canonicalUri.path; | 182 String path = canonicalUri.path; |
| 183 return path.substring(path.lastIndexOf('/') + 1); | 183 return path.substring(path.lastIndexOf('/') + 1); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 @override | 646 @override |
| 647 bool get isBoolFromEnvironmentConstructor { | 647 bool get isBoolFromEnvironmentConstructor { |
| 648 return fromEnvironmentState == _FromEnvironmentState.BOOL; | 648 return fromEnvironmentState == _FromEnvironmentState.BOOL; |
| 649 } | 649 } |
| 650 | 650 |
| 651 @override | 651 @override |
| 652 bool get isStringFromEnvironmentConstructor { | 652 bool get isStringFromEnvironmentConstructor { |
| 653 return fromEnvironmentState == _FromEnvironmentState.STRING; | 653 return fromEnvironmentState == _FromEnvironmentState.STRING; |
| 654 } | 654 } |
| 655 } | 655 } |
| OLD | NEW |