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

Unified Diff: sky/engine/core/script/dart_controller.cc

Issue 1088263004: Ensure isolates have a root library so createMirrorSystem() and spawnUri() are happy. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | sky/tests/dart/mirror-system.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/script/dart_controller.cc
diff --git a/sky/engine/core/script/dart_controller.cc b/sky/engine/core/script/dart_controller.cc
index 2a05e58855233c32072551cf6226ece0e1de2935..dc7ce4c78a63d901d5517e4a7b55e984c7671a8d 100644
--- a/sky/engine/core/script/dart_controller.cc
+++ b/sky/engine/core/script/dart_controller.cc
@@ -204,6 +204,10 @@ static Dart_Isolate IsolateCreateCallback(const char* script_uri,
DartApiScope apiScope;
Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
Builtin::SetNativeResolver(Builtin::kMojoInternalLibrary);
+
+ // Ensure the isolate has a root library.
+ Dart_LoadScript(Dart_NewStringFromCString("dart:empty"),
+ Dart_NewStringFromCString(""), 0, 0);
}
Dart_ExitIsolate();
@@ -273,6 +277,10 @@ void DartController::CreateIsolateFor(Document* document) {
{
DartApiScope apiScope;
+ // Ensure the isolate has a root library.
+ Dart_LoadScript(Dart_NewStringFromCString("dart:empty"),
+ Dart_NewStringFromCString(""), 0, 0);
+
Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
Builtin::SetNativeResolver(Builtin::kMojoInternalLibrary);
BuiltinNatives::Init();
« no previous file with comments | « no previous file | sky/tests/dart/mirror-system.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698