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

Unified Diff: lib/compiler/implementation/elements/elements.dart

Issue 10697003: Various token issues fixed in the compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698