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

Unified Diff: sdk/lib/isolate/isolate.dart

Issue 1334353002: - Add getters for the current packageRoot or packageMap. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Moved accessors for packageRoot/packageMap to class Isolate. Created 5 years, 3 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 | « runtime/lib/isolate_patch.dart ('k') | tests/isolate/package_root_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/isolate/isolate.dart
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index c67122049f1a8e543e21ceb2cbb1af7b176a25a8..d6b4c0b5b41e50ff1b0005640f2b9f614965559f 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -127,6 +127,29 @@ class Isolate {
external static Isolate get current;
/**
+ * Returns the package root of the current isolate, if any.
+ *
+ * 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.
+ */
+ external static Future<Uri> get packageRoot;
nweiz 2015/10/06 23:33:21 Are there any guarantees about whether this is abs
Lasse Reichstein Nielsen 2015/10/07 07:48:28 It should be absolute. We should add this to the d
+
+ /**
+ * Returns the package mapping of the current isolate, if any.
+ *
+ * If the current isolate is using a [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.
+ */
+ external static Future<Map<String, Uri>> get packageMap;
+
+ /**
* Creates and spawns an isolate that shares the same code as the current
* isolate.
*
« no previous file with comments | « runtime/lib/isolate_patch.dart ('k') | tests/isolate/package_root_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698