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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2489383002: Don't add imports/exports elements for invalid URIs, with null Source. (Closed)
Patch Set: Created 4 years, 1 month 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/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index c95f67f98e9056a84acf82f684b01758eb39835e..128f3fefd768f6a1caeb8737c411a7dec15e4453 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -19,10 +19,8 @@ import 'package:analyzer/src/generated/resolver.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/generated/testing/ast_factory.dart';
import 'package:analyzer/src/generated/testing/token_factory.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:analyzer/src/summary/format.dart';
import 'package:analyzer/src/summary/idl.dart';
-import 'package:analyzer/src/util/fast_uri.dart';
/**
* Implementation of [ElementResynthesizer] used when resynthesizing an element
@@ -1162,9 +1160,12 @@ class _LibraryResynthesizerContext implements LibraryResynthesizerContext {
}
LibraryElementHandle _getLibraryByRelativeUri(String depUri) {
- String absoluteUri = resolveRelativeUri(
- resynthesizer.librarySource.uri, FastUri.parse(depUri))
- .toString();
+ Source source = resynthesizer.summaryResynthesizer.sourceFactory
+ .resolveUri(resynthesizer.librarySource, depUri);
+ if (source == null) {
+ return null;
+ }
+ String absoluteUri = source.uri.toString();
return new LibraryElementHandle(resynthesizer.summaryResynthesizer,
new ElementLocationImpl.con3(<String>[absoluteUri]));
}
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698