| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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'); | 5 #library('elements'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
| 10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 645 |
| 646 bool hasLibraryName() => libraryTag !== null; | 646 bool hasLibraryName() => libraryTag !== null; |
| 647 | 647 |
| 648 /** | 648 /** |
| 649 * Returns the library name (as defined by the #library tag) or for script | 649 * Returns the library name (as defined by the #library tag) or for script |
| 650 * (which have no #library tag) the script file name. The latter case is used | 650 * (which have no #library tag) the script file name. The latter case is used |
| 651 * to private 'library name' for scripts to use for instance in dartdoc. | 651 * to private 'library name' for scripts to use for instance in dartdoc. |
| 652 */ | 652 */ |
| 653 String getLibraryOrScriptName() { | 653 String getLibraryOrScriptName() { |
| 654 if (libraryTag !== null) { | 654 if (libraryTag !== null) { |
| 655 return libraryTag.argument.dartString.slowToString(); | 655 return libraryTag.name.toString(); |
| 656 } else { | 656 } else { |
| 657 // Use the file name as script name. | 657 // Use the file name as script name. |
| 658 String path = uri.path; | 658 String path = uri.path; |
| 659 return path.substring(path.lastIndexOf('/') + 1); | 659 return path.substring(path.lastIndexOf('/') + 1); |
| 660 } | 660 } |
| 661 } | 661 } |
| 662 | 662 |
| 663 // TODO(johnniwinther): Rewrite to avoid the optional argument. | 663 // TODO(johnniwinther): Rewrite to avoid the optional argument. |
| 664 Scope buildEnclosingScope({bool patchScope: false}) { | 664 Scope buildEnclosingScope({bool patchScope: false}) { |
| 665 if (origin !== null) { | 665 if (origin !== null) { |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 | 1873 |
| 1874 MetadataAnnotation ensureResolved(Compiler compiler) { | 1874 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1875 if (resolutionState == STATE_NOT_STARTED) { | 1875 if (resolutionState == STATE_NOT_STARTED) { |
| 1876 compiler.resolver.resolveMetadataAnnotation(this); | 1876 compiler.resolver.resolveMetadataAnnotation(this); |
| 1877 } | 1877 } |
| 1878 return this; | 1878 return this; |
| 1879 } | 1879 } |
| 1880 | 1880 |
| 1881 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1881 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1882 } | 1882 } |
| OLD | NEW |