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

Unified Diff: runtime/bin/platform_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: 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/bin/platform_patch.dart
diff --git a/runtime/bin/platform_patch.dart b/runtime/bin/platform_patch.dart
index c917b54f77c2d65f54543f218e068226859e4e9e..97afd96225023d75a169af9f79ee1597497dc0f3 100644
--- a/runtime/bin/platform_patch.dart
+++ b/runtime/bin/platform_patch.dart
@@ -15,6 +15,21 @@ patch class _Platform {
/* patch */ static _environment() native "Platform_Environment";
/* patch */ static List<String> _executableArguments()
native "Platform_ExecutableArguments";
- /* patch */ static String _packageRoot() native "Platform_PackageRoot";
/* patch */ static String _version() native "Platform_GetVersion";
+
+ /* patch */ static Future<Uri> get packageRoot {
+ var hook = VMLibraryHooks.getPackageRoot;
siva 2015/09/14 18:12:07 indentation seems to be off.
+ if (hook == null) {
+ throw new UnimplementedError("Platform.packageRoot");
+ }
+ return hook();
+ }
+
+ /* patch */ static Future<Map<String, Uri>> get packageMap {
+ var hook = VMLibraryHooks.getPackageMap;
+ if (hook == null) {
+ throw new UnimplementedError("Platform.packageMap");
+ }
+ return hook();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698