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

Unified Diff: runtime/bin/platform.cc

Issue 1307183002: Add access to the isolate package-root/package-map in Platform. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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.cc
diff --git a/runtime/bin/platform.cc b/runtime/bin/platform.cc
index 0ed2bd364fd10eec6d347472f6233379e94a3cc1..735bc432476664c60001c4656fb8c0b3a378f1f1 100644
--- a/runtime/bin/platform.cc
+++ b/runtime/bin/platform.cc
@@ -85,6 +85,22 @@ void FUNCTION_NAME(Platform_PackageRoot)(Dart_NativeArguments args) {
}
+void FUNCTION_NAME(Platform_PackageResolution)(Dart_NativeArguments args) {
Ivan Posva 2015/08/26 04:29:35 There should be no need to rely on C++ code for th
Lasse Reichstein Nielsen 2015/08/26 06:26:06 Excellent. It did seem a bit overengineered to go
+ Dart_Handle builtin_lib =
+ Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
+ ASSERT(!Dart_IsError(builtin_lib));
+ Dart_Handle field_name = DartUtils::NewString("_packageRoot");
+ Dart_Handle result = Dart_GetField(builtin_lib, field_name);
+ ASSERT(!Dart_IsError(result));
+ if (Dart_IsNull(result)) {
+ field_name = DartUtils::NewString("_packageMap");
+ result = Dart_GetField(builtin_lib, field_name);
+ ASSERT(!Dart_IsError(result));
+ }
+ Dart_SetReturnValue(args, result);
+}
+
+
void FUNCTION_NAME(Platform_Environment)(Dart_NativeArguments args) {
intptr_t count = 0;
char** env = Platform::Environment(&count);

Powered by Google App Engine
This is Rietveld 408576698