Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index a3c3134c89e032b9817f45008ababb177251371b..f25747cdd707c74414acb52d4c3e7951e379e94c 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -5191,6 +5191,18 @@ DART_EXPORT Dart_Handle Dart_RootLibrary() { |
} |
+DART_EXPORT Dart_Handle Dart_SetRootLibrary(Dart_Handle library) { |
+ DARTSCOPE(Thread::Current()); |
+ const Library& lib = Api::UnwrapLibraryHandle(Z, library); |
+ if (lib.IsNull()) { |
+ RETURN_TYPE_ERROR(Z, library, Library); |
+ } |
+ Isolate* isolate = Isolate::Current(); |
+ isolate->object_store()->set_root_library(lib); |
+ return library; |
+} |
+ |
+ |
DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, |
Dart_Handle class_name) { |
DARTSCOPE(Thread::Current()); |