Chromium Code Reviews| Index: pkg/path/lib/src/context.dart |
| diff --git a/pkg/path/lib/src/context.dart b/pkg/path/lib/src/context.dart |
| index f3826d78c6c307fe23c84184aea9f22e7b7751f2..a62c6a142fa0b2e6e978154f04e8aba87a801bdb 100644 |
| --- a/pkg/path/lib/src/context.dart |
| +++ b/pkg/path/lib/src/context.dart |
| @@ -219,7 +219,7 @@ class Context { |
| // replaces the path after it. |
| var parsed = _parse(part); |
| parsed.root = this.rootPrefix(buffer.toString()); |
| - if (parsed.root.contains(style.needsSeparatorPattern)) { |
| + if (style.needsSeparator(parsed.root)) { |
| parsed.separators[0] = style.separator; |
| } |
| buffer.clear(); |
| @@ -230,7 +230,7 @@ class Context { |
| buffer.clear(); |
| buffer.write(part); |
| } else { |
| - if (part.length > 0 && part[0].contains(style.separatorPattern)) { |
| + if (part.length > 0 && style.separators.any(part[0].contains)) { |
|
Bob Nystrom
2014/06/02 22:43:05
How about making this a method too:
style.contain
nweiz
2014/06/02 23:13:25
Done.
|
| // The part starts with a separator, so we don't need to add one. |
| } else if (needsSeparator) { |
| buffer.write(separator); |
| @@ -241,7 +241,7 @@ class Context { |
| // Unless this part ends with a separator, we'll need to add one before |
| // the next part. |
| - needsSeparator = part.contains(style.needsSeparatorPattern); |
| + needsSeparator = style.needsSeparator(part); |
| } |
| return buffer.toString(); |