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

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: code review 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
« no previous file with comments | « pkg/path/CHANGELOG.md ('k') | pkg/path/lib/src/internal_style.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.");
+ }
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;
« no previous file with comments | « pkg/path/CHANGELOG.md ('k') | pkg/path/lib/src/internal_style.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698