Index: sdk/lib/io/platform.dart |
diff --git a/sdk/lib/io/platform.dart b/sdk/lib/io/platform.dart |
index 56ddea0193b0df98b43e703e0c98828f4eb1e696..e94ba4c08e21fa1ba7d9a0e8d1ff39fae5983a5a 100644 |
--- a/sdk/lib/io/platform.dart |
+++ b/sdk/lib/io/platform.dart |
@@ -176,13 +176,26 @@ class Platform { |
static List<String> get executableArguments => _Platform.executableArguments; |
/** |
- * Returns the value of the --package-root flag passed to the executable |
- * used to run the script in this isolate. This is the directory in which |
- * Dart packages are looked up. |
+ * Returns the package root of the current isolate, if any. |
* |
- * If there is no --package-root flag, then the empty string is returned. |
+ * If the isolate is using a [packageMap], this getter returns `null`, |
+ * otherwise it returns the package root - a directory that package |
+ * URIs are resolved against. |
*/ |
- static String get packageRoot => _Platform.packageRoot; |
+ static Future<Uri> get packageRoot => _Platform.packageRoot; |
+ |
+ /** |
+ * Returns the package mapping of the current isolate, if any. |
+ * |
+ * If the current isolate is using [packageRoot], this getter returns `null`. |
+ * |
+ * The package map maps the name of a package that is available to the |
+ * program, to a URI that package URIs for that package are resolved against. |
+ * |
+ * Returns an empty map if the isolate does not have a way to resolve package |
+ * URIs. |
+ */ |
+ static Future<Map<String, Uri>> get packageMap => _Platform.packageMap; |
/** |
* Returns the version of the current Dart runtime. |