Index: pkg/path/lib/src/context.dart |
diff --git a/pkg/path/lib/src/context.dart b/pkg/path/lib/src/context.dart |
index 823e0c28402d83b6b7db1e0f305174be5ac303f7..eecb1df96111013eabac749ac51ac303e8f01e9a 100644 |
--- a/pkg/path/lib/src/context.dart |
+++ b/pkg/path/lib/src/context.dart |
@@ -41,13 +41,20 @@ class Context { |
return new Context._(style, current); |
} |
- Context._(this.style, this.current); |
+ /// Create a [Context] to be used internally within path. |
+ Context.internal() : style = Style.platform; |
Bob Nystrom
2014/08/01 16:32:07
Since _current is final, don't you need to initial
Anders Johnsen
2014/08/04 06:33:14
It's auto-initialized to null.
Anders Johnsen
2014/08/04 06:58:07
Ha, nice one Anders... You are of cause right - fi
|
+ |
+ Context._(this.style, this._current); |
/// The style of path that this context works with. |
final InternalStyle style; |
- /// The current directory that relative paths will be relative to. |
- final String current; |
+ /// The current directory given when Context was created. If null, current |
+ /// directory is evaluated from 'p.current'. |
+ final String _current; |
+ |
+ /// The current directory that relative paths are relative to. |
+ String get current => _current != null ? _current : p.current; |
/// Gets the path separator for the context's [style]. On Mac and Linux, |
/// this is `/`. On Windows, it's `\`. |