Chromium Code Reviews| Index: lib/compiler/implementation/elements/elements.dart |
| diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart |
| index 1878a37c3221e27c4bf750c76444dd147556fd00..bece73675567c7f4f055284411da0fa1bdeaf823 100644 |
| --- a/lib/compiler/implementation/elements/elements.dart |
| +++ b/lib/compiler/implementation/elements/elements.dart |
| @@ -205,6 +205,8 @@ class Element implements Hashable { |
| } |
| toString() { |
| + // TODO(johnniwinther): Test for nullness of name, or make non-nullness an |
| + // invariant for all element types. |
| if (!isTopLevel()) { |
| String holderName = enclosingElement.name.slowToString(); |
| return '$kind($holderName#${name.slowToString()})'; |
| @@ -359,6 +361,16 @@ class LibraryElement extends CompilationUnitElement { |
| } |
| bool hasLibraryName() => libraryTag !== null; |
| + |
| + String getLibraryOrScriptName() { |
|
ahe
2012/06/27 10:48:27
What is this method for?
|
| + if (libraryTag !== null) { |
| + return libraryTag.argument.dartString.slowToString(); |
| + } else { |
| + // Use the file name as script name. |
| + var path = script.uri.path; |
| + return path.substring(path.lastIndexOf('/')+1); |
|
Lasse Reichstein Nielsen
2012/06/27 09:22:16
Spaces around '+'.
What is the script name used fo
|
| + } |
| + } |
| } |
| class PrefixElement extends Element { |