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

Unified Diff: packages/path/lib/src/parsed_path.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/path/lib/src/internal_style.dart ('k') | packages/path/lib/src/path_exception.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/path/lib/src/parsed_path.dart
diff --git a/packages/path/lib/src/parsed_path.dart b/packages/path/lib/src/parsed_path.dart
index d37e2d396211dcc195d103c8e7df1326c220f60a..619ffbf45696b70b80242e8b70be26006c4ae9f1 100644
--- a/packages/path/lib/src/parsed_path.dart
+++ b/packages/path/lib/src/parsed_path.dart
@@ -2,8 +2,6 @@
// 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.
-library path.parsed_path;
-
import 'internal_style.dart';
import 'style.dart';
@@ -99,7 +97,7 @@ class ParsedPath {
if (separators.length > 0) separators[separators.length - 1] = '';
}
- void normalize() {
+ void normalize({bool canonicalize: false}) {
// Handle '.', '..', and empty parts.
var leadingDoubles = 0;
var newParts = <String>[];
@@ -115,7 +113,7 @@ class ParsedPath {
leadingDoubles++;
}
} else {
- newParts.add(part);
+ newParts.add(canonicalize ? style.canonicalizePart(part) : part);
}
}
@@ -141,6 +139,7 @@ class ParsedPath {
// Normalize the Windows root if needed.
if (root != null && style == Style.windows) {
+ if (canonicalize) root = root.toLowerCase();
root = root.replaceAll('/', '\\');
}
removeTrailingSeparators();
« no previous file with comments | « packages/path/lib/src/internal_style.dart ('k') | packages/path/lib/src/path_exception.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698