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

Side by Side Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 2176363002: Removed io dependencies in analyzer to allow compiler to run in the browser (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Refactored summary_sdk Created 4 years, 4 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
OLDNEW
1 import 'dart:io' as io; 1 import 'dart:io' as io;
2 2
3 import 'package:analyzer/dart/element/element.dart'; 3 import 'package:analyzer/dart/element/element.dart';
4 import 'package:analyzer/src/context/cache.dart'; 4 import 'package:analyzer/src/context/cache.dart';
5 import 'package:analyzer/src/context/context.dart'; 5 import 'package:analyzer/src/context/context.dart';
6 import 'package:analyzer/src/dart/element/element.dart'; 6 import 'package:analyzer/src/dart/element/element.dart';
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/java_io.dart'; 8 import 'package:analyzer/src/generated/java_io.dart';
9 import 'package:analyzer/src/generated/resolver.dart'; 9 import 'package:analyzer/src/generated/resolver.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 /** 267 /**
268 * Map from the URI of a library to the linked summary of that library. 268 * Map from the URI of a library to the linked summary of that library.
269 */ 269 */
270 final Map<String, LinkedLibrary> linkedMap = <String, LinkedLibrary>{}; 270 final Map<String, LinkedLibrary> linkedMap = <String, LinkedLibrary>{};
271 271
272 /** 272 /**
273 * Map from the URI of a library to the summary path that contained it. 273 * Map from the URI of a library to the summary path that contained it.
274 */ 274 */
275 final Map<String, String> uriToSummaryPath = <String, String>{}; 275 final Map<String, String> uriToSummaryPath = <String, String>{};
276 276
277 SummaryDataStore(Iterable<String> summaryPaths) { 277 SummaryDataStore(Iterable<String> summaryPaths, [PackageBundle bundle]) {
Paul Berry 2016/07/26 21:16:22 These changes shouldn't be necessary--the caller s
priscillalee 2016/07/26 21:32:48 Done.
278 summaryPaths.forEach(_fillMaps); 278 summaryPaths.forEach(_fillMaps);
279 if (bundle != null) addBundle('dart_sdk.sum', bundle);
279 } 280 }
280 281
281 /** 282 /**
282 * Add the given [bundle] loaded from the file with the given [path]. 283 * Add the given [bundle] loaded from the file with the given [path].
283 */ 284 */
284 void addBundle(String path, PackageBundle bundle) { 285 void addBundle(String path, PackageBundle bundle) {
285 bundles.add(bundle); 286 bundles.add(bundle);
286 for (int i = 0; i < bundle.unlinkedUnitUris.length; i++) { 287 for (int i = 0; i < bundle.unlinkedUnitUris.length; i++) {
287 String uri = bundle.unlinkedUnitUris[i]; 288 String uri = bundle.unlinkedUnitUris[i];
288 uriToSummaryPath[uri] = path; 289 uriToSummaryPath[uri] = path;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 * also provides [summaryPath]. 341 * also provides [summaryPath].
341 */ 342 */
342 class _InSummaryFallbackSource extends FileBasedSource 343 class _InSummaryFallbackSource extends FileBasedSource
343 implements InSummarySource { 344 implements InSummarySource {
344 @override 345 @override
345 final String summaryPath; 346 final String summaryPath;
346 347
347 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath) 348 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath)
348 : super(file, uri); 349 : super(file, uri);
349 } 350 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('j') | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698