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

Unified Diff: pkg/path/lib/src/context.dart

Issue 304843002: Deprecate publicly-visible properties on Style in path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
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;

Powered by Google App Engine
This is Rietveld 408576698