Index: pkg/path/lib/src/context.dart |
diff --git a/pkg/path/lib/src/context.dart b/pkg/path/lib/src/context.dart |
index 88ca61fa5eee43d2478fd5f68616c3261d55fd0f..f3826d78c6c307fe23c84184aea9f22e7b7751f2 100644 |
--- a/pkg/path/lib/src/context.dart |
+++ b/pkg/path/lib/src/context.dart |
@@ -4,6 +4,7 @@ |
library path.context; |
+import 'internal_style.dart'; |
import 'style.dart'; |
import 'parsed_path.dart'; |
import 'path_exception.dart'; |
@@ -30,7 +31,12 @@ class Context { |
} |
} |
- if (style == null) style = Style.platform; |
+ if (style == null) { |
+ style = Style.platform; |
+ } else if (style is! InternalStyle) { |
+ throw new ArgumentError("Only styles defined by the path package are " |
+ "allowed."); |
Bob Nystrom
2014/05/29 15:45:39
This is a breaking change, I think.
One option wo
nweiz
2014/05/29 20:17:00
This could technically break someone, but as you m
Bob Nystrom
2014/05/29 23:54:10
If we don't think this will break anyone, then we
nweiz
2014/05/30 00:52:14
Because it's (somewhat) plausible that people are
|
+ } |
return new Context._(style, current); |
} |
@@ -38,7 +44,7 @@ class Context { |
Context._(this.style, this.current); |
/// The style of path that this context works with. |
- final Style style; |
+ final InternalStyle style; |
/// The current directory that relative paths will be relative to. |
final String current; |