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

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

Issue 1653163003: Use LinkedDependency.parts to find part URIs during resynthesis. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 4
5 library summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 partUri = partSource.uri.toString(); 1416 partUri = partSource.uri.toString();
1417 } else { 1417 } else {
1418 partUri = referencedLibraryUri; 1418 partUri = referencedLibraryUri;
1419 } 1419 }
1420 return <String>[referencedLibraryUri, partUri, name]; 1420 return <String>[referencedLibraryUri, partUri, name];
1421 } 1421 }
1422 LinkedDependency dependency = linkedLibrary.dependencies[dependencyIndex]; 1422 LinkedDependency dependency = linkedLibrary.dependencies[dependencyIndex];
1423 Source referencedLibrarySource = summaryResynthesizer.sourceFactory 1423 Source referencedLibrarySource = summaryResynthesizer.sourceFactory
1424 .resolveUri(librarySource, dependency.uri); 1424 .resolveUri(librarySource, dependency.uri);
1425 String referencedLibraryUri = referencedLibrarySource.uri.toString(); 1425 String referencedLibraryUri = referencedLibrarySource.uri.toString();
1426 // TODO(paulberry): consider changing Location format so that this is
1427 // not necessary (2nd string in location should just be the unit
1428 // number).
1429 String partUri; 1426 String partUri;
1430 if (unit != 0) { 1427 if (unit != 0) {
1431 UnlinkedUnit referencedLibraryDefiningUnit = 1428 String uri = dependency.parts[unit - 1];
1432 summaryResynthesizer._getUnlinkedSummaryOrThrow(referencedLibraryUri);
1433 String uri =
1434 referencedLibraryDefiningUnit.publicNamespace.parts[unit - 1];
1435 Source partSource = summaryResynthesizer.sourceFactory 1429 Source partSource = summaryResynthesizer.sourceFactory
1436 .resolveUri(referencedLibrarySource, uri); 1430 .resolveUri(referencedLibrarySource, uri);
1437 partUri = partSource.uri.toString(); 1431 partUri = partSource.uri.toString();
1438 } else { 1432 } else {
1439 partUri = referencedLibraryUri; 1433 partUri = referencedLibraryUri;
1440 } 1434 }
1441 return <String>[referencedLibraryUri, partUri, name]; 1435 return <String>[referencedLibraryUri, partUri, name];
1442 } 1436 }
1443 1437
1444 /** 1438 /**
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 } 1700 }
1707 : () => this.element; 1701 : () => this.element;
1708 // TODO(paulberry): Is it a bug that we have to pass `false` for 1702 // TODO(paulberry): Is it a bug that we have to pass `false` for
1709 // isInstantiated? 1703 // isInstantiated?
1710 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); 1704 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false);
1711 } else { 1705 } else {
1712 return null; 1706 return null;
1713 } 1707 }
1714 } 1708 }
1715 } 1709 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698