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

Side by Side Diff: pkg/kernel/lib/repository.dart

Issue 2619193003: Insert implicit downcasts in kernel strong mode. (Closed)
Patch Set: Merge 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.repository; 4 library kernel.repository;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 7
8 /// Keeps track of which [Library] objects have been created for a given URI. 8 /// Keeps track of which [Library] objects have been created for a given URI.
9 /// 9 ///
10 /// To load different files into the same IR, pass in the same repository 10 /// To load different files into the same IR, pass in the same repository
11 /// object to the loaders. 11 /// object to the loaders.
12 class Repository { 12 class Repository {
13 final Map<Uri, Library> _uriToLibrary = <Uri, Library>{}; 13 final Map<Uri, Library> _uriToLibrary = <Uri, Library>{};
14 final List<Library> libraries = <Library>[]; 14 final List<Library> libraries = <Library>[];
15 15
16 Library getLibraryReference(Uri uri) { 16 Library getLibraryReference(Uri uri) {
17 assert(uri.hasScheme); 17 assert(uri.hasScheme);
18 return _uriToLibrary.putIfAbsent(uri, () => _buildLibraryReference(uri)); 18 return _uriToLibrary.putIfAbsent(uri, () => _buildLibraryReference(uri));
19 } 19 }
20 20
21 Library _buildLibraryReference(Uri uri) { 21 Library _buildLibraryReference(Uri uri) {
22 assert(uri.hasScheme); 22 assert(uri.hasScheme);
23 var library = new Library(uri, isExternal: true); 23 var library = new Library(uri, isExternal: true)..fileUri = '$uri';
24 libraries.add(library); 24 libraries.add(library);
25 return library; 25 return library;
26 } 26 }
27 } 27 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/ast.dart ('k') | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698