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

Unified Diff: runtime/bin/path_impl.dart

Issue 11189125: Fix path to only use public interface in the implementation of methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/path_impl.dart
diff --git a/runtime/bin/path_impl.dart b/runtime/bin/path_impl.dart
index 8c7386019506f39505bef4d58c28362486e86331..91d1ed332afd6ed55a2c5e16a1ba82c7f5f9bdd2 100644
--- a/runtime/bin/path_impl.dart
+++ b/runtime/bin/path_impl.dart
@@ -41,13 +41,14 @@ class _Path implements Path {
// base.join(relative) == this.canonicalize.
// Throws an exception if no such path exists, or the case is not
// implemented yet.
- if (base.isAbsolute && _path.startsWith(base._path)) {
- if (_path == base._path) return new Path('.');
+ var basePath = base.toString();
+ if (base.isAbsolute && _path.startsWith(basePath)) {
+ if (_path == basePath) return new Path('.');
if (base.hasTrailingSeparator) {
- return new Path(_path.substring(base._path.length));
+ return new Path(_path.substring(basePath.length));
}
- if (_path[base._path.length] == '/') {
- return new Path(_path.substring(base._path.length + 1));
+ if (_path[basePath.length] == '/') {
+ return new Path(_path.substring(basePath.length + 1));
}
} else if (base.isAbsolute && isAbsolute) {
List<String> baseSegments = base.canonicalize().segments();
@@ -89,9 +90,9 @@ class _Path implements Path {
return further.canonicalize();
}
if (hasTrailingSeparator) {
- return new Path('$_path${further._path}').canonicalize();
+ return new Path('$_path${further}').canonicalize();
}
- return new Path('$_path/${further._path}').canonicalize();
+ return new Path('$_path/${further}').canonicalize();
}
// Note: The URI RFC names for these operations are normalize, resolve, and
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698