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

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

Issue 2669863003: Handle invalid URIs in summaries. (Closed)
Patch Set: 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
Index: pkg/analyzer/lib/src/summary/uri.dart
diff --git a/pkg/analyzer/lib/src/summary/uri.dart b/pkg/analyzer/lib/src/summary/uri.dart
new file mode 100644
index 0000000000000000000000000000000000000000..11eca445b9a875ff0d7dd37935edd83c5d263166
--- /dev/null
+++ b/pkg/analyzer/lib/src/summary/uri.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Return `true` is the [uriStr] represents a syntactically correct URI.
+ */
+bool isValidUri(String uriStr) {
Brian Wilkerson 2017/02/01 21:02:10 I can't see any uses of this function (probably ju
scheglov 2017/02/01 21:08:47 You're right, we don't use it. I will remove the f
+ try {
+ Uri.parse(uriStr);
+ return true;
+ } on FormatException {
+ return false;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698