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

Unified Diff: runtime/lib/isolate_patch.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
Index: runtime/lib/isolate_patch.dart
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index daaaf9729f1444dffe5bd40ce83e7a2a53809c99..438d4cbe314580c653721947519cf9473a85bcb2 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -275,6 +275,22 @@ patch class Isolate {
/* patch */ static Isolate get current => _currentIsolate;
+ /* patch */ static Future<Uri> get packageRoot {
+ var hook = VMLibraryHooks.getPackageRoot;
+ if (hook == null) {
+ throw new UnimplementedError("Isolate.packageRoot");
+ }
+ return hook();
+ }
+
+ /* patch */ static Future<Map<String, Uri>> get packageMap {
+ var hook = VMLibraryHooks.getPackageMap;
+ if (hook == null) {
+ throw new UnimplementedError("Isolate.packageMap");
+ }
+ return hook();
+ }
+
/* patch */ static Future<Isolate> spawn(
void entryPoint(message), var message,
{bool paused: false, bool errorsAreFatal,

Powered by Google App Engine
This is Rietveld 408576698