Index: sdk/lib/io/platform_impl.dart |
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart |
index 6380e0d7c92f622495d3c9ca2149db2baafdfda9..f790b8c55e133b20cb15102b591a0517cac63266 100644 |
--- a/sdk/lib/io/platform_impl.dart |
+++ b/sdk/lib/io/platform_impl.dart |
@@ -21,7 +21,7 @@ class _Platform { |
* a non-empty name and a value separated by a '=' character. |
* The name does not contain a '=' character, |
* so the name is everything up to the first '=' character. |
- * Values are everything after the first '=' charcacter. |
+ * Values are everything after the first '=' character. |
* A value may contain further '=' characters, and it may be empty. |
* |
* Returns an [OSError] if retrieving the environment fails. |
@@ -29,13 +29,31 @@ class _Platform { |
external static _environment(); |
external static List<String> _executableArguments(); |
external static String _packageRoot(); |
+ external static _packageResolution(); |
external static String _version(); |
static String executable = _executable(); |
static String resolvedExecutable = _resolvedExecutable(); |
static String packageRoot = _packageRoot(); |
+ static var _resolution = () { |
+ var res = _packageResolution(); |
+ // Do not give users access to the real map. |
+ if (res is Map) res = new Map<String, Uri>.unmodifiable(res); |
+ return res; |
+ } (); |
- // Cache the OS environemnt. This can be an OSError instance if |
+ static Uri get packageRootUri { |
+ if (_resolution is Uri) return _resolution; |
Ivan Posva
2015/08/26 04:29:36
I'll implement these without going through native
Lasse Reichstein Nielsen
2015/08/26 06:26:06
That's fine. I'll just add the interface for now.
|
+ return null; |
+ } |
+ |
+ static Map<String, Uri> get packageMap { |
+ if (_resolution is Map) return _resolution; |
+ if (_resolution == null) return const <String, Uri>{}; |
+ return null; |
+ } |
+ |
+ // Cache the OS environment. This can be an OSError instance if |
// retrieving the environment failed. |
static var _environmentCache; |