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

Unified Diff: runtime/bin/main.cc

Issue 2948273002: Correctly set root_library based on the application script URI instead of looking for the library t… (Closed)
Patch Set: Integrate cl from Siggi for front end change to not require a 'main' method when using the memory f… Created 3 years, 5 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 | « runtime/bin/loader.cc ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 7337d57969328a763215d111e542b3c9b70ede37..4037874fec6826d772dda68c8cd320f5954a0112 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -838,8 +838,20 @@ static Dart_Isolate IsolateSetupHelper(Dart_Isolate isolate,
Dart_Handle result = Dart_SetLibraryTagHandler(Loader::LibraryTagHandler);
CHECK_RESULT(result);
+ // Prepare builtin and other core libraries for use to resolve URIs.
+ // Set up various closures, e.g: printing, timers etc.
+ // Set up 'package root' for URI resolution.
+ result = DartUtils::PrepareForScriptLoading(false, trace_loading);
+ CHECK_RESULT(result);
+
if (kernel_program != NULL) {
- Dart_Handle result = Dart_LoadKernel(kernel_program);
+ Dart_Handle uri = Dart_NewStringFromCString(script_uri);
+ CHECK_RESULT(uri);
+ Dart_Handle resolved_script_uri = DartUtils::ResolveScript(uri);
+ CHECK_RESULT(resolved_script_uri);
+ result =
+ Dart_LoadScript(uri, resolved_script_uri,
+ reinterpret_cast<Dart_Handle>(kernel_program), 0, 0);
CHECK_RESULT(result);
}
if (set_native_resolvers) {
@@ -852,12 +864,6 @@ static Dart_Isolate IsolateSetupHelper(Dart_Isolate isolate,
CHECK_RESULT(result);
}
- // Prepare builtin and other core libraries for use to resolve URIs.
- // Set up various closures, e.g: printing, timers etc.
- // Set up 'package root' for URI resolution.
- result = DartUtils::PrepareForScriptLoading(false, trace_loading);
- CHECK_RESULT(result);
-
// Set up the load port provided by the service isolate so that we can
// load scripts.
result = DartUtils::SetupServiceLoadPort();
« no previous file with comments | « runtime/bin/loader.cc ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698