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

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

Issue 2321263003: Remove parseUriWithException() and URISyntaxException. (Closed)
Patch Set: Created 4 years, 3 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
Index: pkg/analyzer/lib/src/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 90928c882cbd93f187956de710d0fab93fac9f9a..baeaddd9538e52303c26f10e8053f35a0e6a3fb4 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -10526,7 +10526,7 @@ abstract class UriBasedDirectiveImpl extends DirectiveImpl
@override
UriValidationCode validate() {
- StringLiteral uriLiteral = uri;
+ StringLiteral uriLiteral = this.uri;
if (uriLiteral is StringInterpolation) {
return UriValidationCode.URI_WITH_INTERPOLATION;
}
@@ -10537,9 +10537,13 @@ abstract class UriBasedDirectiveImpl extends DirectiveImpl
if (this is ImportDirective && uriContent.startsWith(_DART_EXT_SCHEME)) {
return UriValidationCode.URI_WITH_DART_EXT_SCHEME;
}
+ Uri uri;
try {
- parseUriWithException(Uri.encodeFull(uriContent));
- } on URISyntaxException {
+ uri = Uri.parse(Uri.encodeFull(uriContent));
+ } on FormatException {
+ return UriValidationCode.INVALID_URI;
+ }
+ if (uri.path.isEmpty) {
return UriValidationCode.INVALID_URI;
}
return null;

Powered by Google App Engine
This is Rietveld 408576698