Chromium Code Reviews| 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; |
| } |