Chromium Code Reviews| Index: lib/src/context.dart |
| diff --git a/lib/src/context.dart b/lib/src/context.dart |
| index a3efd95a9cbd4c4b5829df32149857911d4f1028..7a210c60d92769acc5bd242cbeceb653b07d5794 100644 |
| --- a/lib/src/context.dart |
| +++ b/lib/src/context.dart |
| @@ -324,7 +324,11 @@ class Context { |
| /// "/", no path can be determined. In this case, a [PathException] will be |
| /// thrown. |
| String relative(String path, {String from}) { |
| - from = from == null ? current : this.join(current, from); |
| + if (from == null) { |
| + from = current; |
| + } else if (this.isRelative(from) || this.isRootRelative(from)) { |
|
Bob Nystrom
2015/02/18 17:09:08
Document this:
// Avoid calling [current] since i
|
| + from = this.join(current, from); |
| + } |
| // We can't determine the path from a relative path to an absolute path. |
| if (this.isRelative(from) && this.isAbsolute(path)) { |