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

Unified Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2669863003: Handle invalid URIs in summaries. (Closed)
Patch Set: Remove uri.dart, tweak for summarize_ast_test. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 05528d7f03960538894c15a1bc7dd2c17eab31bf..32a8bf44c9c03941fb9ad3b50c48e055fe3d0192 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -4258,8 +4258,12 @@ class ParseDartTask extends SourceBasedAnalysisTask {
UriValidationCode code =
UriBasedDirectiveImpl.validateUri(isImport, uriLiteral, uriContent);
if (code == null) {
- String encodedUriContent = Uri.encodeFull(uriContent);
- return context.sourceFactory.resolveUri(_source, encodedUriContent);
+ try {
+ Uri.parse(uriContent);
+ } on FormatException {
+ return null;
+ }
+ return context.sourceFactory.resolveUri(_source, uriContent);
} else if (code == UriValidationCode.URI_WITH_DART_EXT_SCHEME) {
return null;
} else if (code == UriValidationCode.URI_WITH_INTERPOLATION) {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.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