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

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

Issue 2632643002: Remove LibraryEntity.libraryName (Closed)
Patch Set: Replace libraryOrScriptName with name 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
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);
});
}

Powered by Google App Engine
This is Rietveld 408576698