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

Unified Diff: pkg/kernel/lib/repository.dart

Issue 2665723002: Implement canonical name scheme in kernel. (Closed)
Patch Set: Address comments Created 3 years, 11 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/kernel/lib/repository.dart
diff --git a/pkg/kernel/lib/repository.dart b/pkg/kernel/lib/repository.dart
index 73cc1a9ac74bcac1274b5242ffe74a176fe6baf7..1319355aa67ef397ae32501f447ac12a0eb68656 100644
--- a/pkg/kernel/lib/repository.dart
+++ b/pkg/kernel/lib/repository.dart
@@ -10,18 +10,10 @@ import 'ast.dart';
/// To load different files into the same IR, pass in the same repository
/// object to the loaders.
class Repository {
ahe 2017/02/02 16:24:01 Can you remove this class now?
asgerf 2017/02/03 10:31:16 Yes, thank you. I actually meant to remove it.
- final Map<Uri, Library> _uriToLibrary = <Uri, Library>{};
- final List<Library> libraries = <Library>[];
+ final Program program = new Program();
- Library getLibraryReference(Uri uri) {
- assert(uri.hasScheme);
- return _uriToLibrary.putIfAbsent(uri, () => _buildLibraryReference(uri));
- }
+ Library getLibraryReference(Uri uri) => program.getLibraryReference(uri);
- Library _buildLibraryReference(Uri uri) {
- assert(uri.hasScheme);
- var library = new Library(uri, isExternal: true)..fileUri = '$uri';
- libraries.add(library);
- return library;
- }
+ List<Library> get libraries => program.libraries;
+ CanonicalName get root => program.root;
}

Powered by Google App Engine
This is Rietveld 408576698