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

Unified Diff: third_party/pkg/route_hierarchical/lib/url_pattern.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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: third_party/pkg/route_hierarchical/lib/url_pattern.dart
diff --git a/third_party/pkg/route_hierarchical/lib/url_pattern.dart b/third_party/pkg/route_hierarchical/lib/url_pattern.dart
index ee465f9bd642357fd6e41942c66c6d5c9b47a727..ade9e9405465b40f4ffe9cb6604488dbcdb8401b 100644
--- a/third_party/pkg/route_hierarchical/lib/url_pattern.dart
+++ b/third_party/pkg/route_hierarchical/lib/url_pattern.dart
@@ -53,7 +53,7 @@ UrlPattern urlPattern(String p) => new UrlPattern(p);
* server.addRequestHandler(matchesUrl(articleUrl), serveArticle);
* }
*
- * serveArcticle(req, res) {
+ * serveArticle(req, res) {
* var articleId = articleUrl.parse(req.path)[0];
* // ...
* }
@@ -94,15 +94,14 @@ class UrlPattern implements UrlMatcher, Pattern {
String reverse(Iterable args, {bool useFragment: false}) {
var sb = new StringBuffer();
- var chars = pattern.split('');
var argsIter = args.iterator;
int depth = 0;
int groupCount = 0;
bool escaped = false;
- for (int i = 0; i < chars.length; i++) {
- var c = chars[i];
+ for (int i = 0; i < pattern.length; i++) {
+ var c = pattern[i];
if (c == '\\' && escaped == false) {
escaped = true;
} else {
@@ -198,17 +197,10 @@ class UrlPattern implements UrlMatcher, Pattern {
* fragment to the server, so the server will have to handle just the path
* part.
*/
- bool matchesNonFragment(String str) {
- if (!_hasFragment) {
- return matches(str);
- } else {
- return _matches(_baseRegex, str);
- }
- }
+ bool matchesNonFragment(String str) =>
+ _hasFragment ? _matches(_baseRegex, str) : matches(str);
- Iterable<Match> allMatches(String str) {
- return regex.allMatches(str);
- }
+ Iterable<Match> allMatches(String str) => regex.allMatches(str);
bool operator ==(other) =>
(other is UrlPattern) && (other.pattern == pattern);
@@ -280,7 +272,6 @@ class UrlPattern implements UrlMatcher, Pattern {
sb.write(c);
}
}
-// sb.write(r'$');
_regex = new RegExp(sb.toString());
}
« no previous file with comments | « third_party/pkg/route_hierarchical/lib/pattern.dart ('k') | third_party/pkg/route_hierarchical/scripts/env.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698