| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import 'elements.dart'; | 7 import 'elements.dart'; |
| 8 import '../../compiler.dart' as api; | 8 import '../../compiler.dart' as api; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 return localScope.values.where((Element element) { | 927 return localScope.values.where((Element element) { |
| 928 // At this point [localScope] only contains members so we don't need | 928 // At this point [localScope] only contains members so we don't need |
| 929 // to check for foreign or prefix elements. | 929 // to check for foreign or prefix elements. |
| 930 return !isPrivateName(element.name); | 930 return !isPrivateName(element.name); |
| 931 }); | 931 }); |
| 932 } | 932 } |
| 933 | 933 |
| 934 bool hasLibraryName() => libraryTag != null; | 934 bool hasLibraryName() => libraryTag != null; |
| 935 | 935 |
| 936 /** | 936 /** |
| 937 * Returns the library name, which is either the name given in the library tag |
| 938 * or the empty string if there is no library tag. |
| 939 */ |
| 940 String getLibraryName() { |
| 941 if (libraryTag == null) return ''; |
| 942 return libraryTag.name.toString(); |
| 943 } |
| 944 |
| 945 /** |
| 937 * Returns the library name (as defined by the library tag) or for script | 946 * Returns the library name (as defined by the library tag) or for script |
| 938 * (which have no library tag) the script file name. The latter case is used | 947 * (which have no library tag) the script file name. The latter case is used |
| 939 * to private 'library name' for scripts to use for instance in dartdoc. | 948 * to private 'library name' for scripts to use for instance in dartdoc. |
| 940 */ | 949 */ |
| 941 String getLibraryOrScriptName() { | 950 String getLibraryOrScriptName() { |
| 942 if (libraryTag != null) { | 951 if (libraryTag != null) { |
| 943 return libraryTag.name.toString(); | 952 return libraryTag.name.toString(); |
| 944 } else { | 953 } else { |
| 945 // Use the file name as script name. | 954 // Use the file name as script name. |
| 946 String path = canonicalUri.path; | 955 String path = canonicalUri.path; |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 | 2363 |
| 2355 MetadataAnnotation ensureResolved(Compiler compiler) { | 2364 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2356 if (resolutionState == STATE_NOT_STARTED) { | 2365 if (resolutionState == STATE_NOT_STARTED) { |
| 2357 compiler.resolver.resolveMetadataAnnotation(this); | 2366 compiler.resolver.resolveMetadataAnnotation(this); |
| 2358 } | 2367 } |
| 2359 return this; | 2368 return this; |
| 2360 } | 2369 } |
| 2361 | 2370 |
| 2362 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2371 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2363 } | 2372 } |
| OLD | NEW |