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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 26291005: dart2js: The name of a library without a library declaration is the empty string. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 2 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: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index b7d6f5ef84ca0d0c830bc6bd2657e19834b85d40..56a35e9bc2e87b07d7ae1916a9e52fb591952850 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -934,6 +934,15 @@ class LibraryElementX extends ElementX implements LibraryElement {
bool hasLibraryName() => libraryTag != null;
/**
+ * Returns the library name, which is either the name given in the library tag
+ * or the empty string if there is no library tag.
+ */
+ String getLibraryName() {
+ if (libraryTag == null) return '';
+ return libraryTag.name.toString();
+ }
+
+ /**
* Returns the library name (as defined by the library tag) or for script
* (which have no library tag) the script file name. The latter case is used
* to private 'library name' for scripts to use for instance in dartdoc.

Powered by Google App Engine
This is Rietveld 408576698