Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: pkg/compiler/lib/src/elements/common.dart

Issue 2632643002: Remove LibraryEntity.libraryName (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698