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

Unified Diff: pkg/compiler/lib/src/kernel/world_builder.dart

Issue 2632643002: Remove LibraryEntity.libraryName (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 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
« no previous file with comments | « pkg/compiler/lib/src/kernel/elements.dart ('k') | pkg/compiler/lib/src/mirrors_used.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/world_builder.dart
diff --git a/pkg/compiler/lib/src/kernel/world_builder.dart b/pkg/compiler/lib/src/kernel/world_builder.dart
index cd4d70365c57b9832982092b3fb9c628bef296a7..d7360e72a5a7923f52b1a6998265b3884d000173 100644
--- a/pkg/compiler/lib/src/kernel/world_builder.dart
+++ b/pkg/compiler/lib/src/kernel/world_builder.dart
@@ -60,8 +60,13 @@ class KernelWorldBuilder extends KernelElementAdapterMixin {
KLibrary _getLibrary(ir.Library node, [KLibraryEnv libraryEnv]) {
return _libraryMap.putIfAbsent(node, () {
_libraryEnvs.add(libraryEnv ?? _env.lookupLibrary(node.importUri));
- return new KLibrary(_libraryMap.length, node.name ?? '${node.importUri}',
- node.name ?? node.fileUri ?? '${node.importUri}');
+ String name = node.name;
+ if (name == null) {
+ // Use the file name as script name.
+ String path = node.importUri.path;
+ name = path.substring(path.lastIndexOf('/') + 1);
+ }
+ return new KLibrary(_libraryMap.length, name);
});
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/elements.dart ('k') | pkg/compiler/lib/src/mirrors_used.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698