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

Unified Diff: runtime/bin/dartutils.cc

Issue 411793003: Fix for the load error that is happening with dart_no_snapshot. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
===================================================================
--- runtime/bin/dartutils.cc (revision 38484)
+++ runtime/bin/dartutils.cc (working copy)
@@ -781,30 +781,31 @@
Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
Dart_Handle builtin_lib) {
+ // First ensure all required libraries are available.
+ Dart_Handle url = NewString(kAsyncLibURL);
+ DART_CHECK_VALID(url);
+ Dart_Handle async_lib = Dart_LookupLibrary(url);
+ DART_CHECK_VALID(async_lib);
+ Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
+
+ // We need to ensure that all the scripts loaded so far are finalized
+ // as we are about to invoke some Dart code below to setup closures.
+ Dart_Handle result = Dart_FinalizeLoading(false);
+ DART_CHECK_VALID(result);
+
// Setup the internal library's 'internalPrint' function.
Dart_Handle print = Dart_Invoke(
builtin_lib, NewString("_getPrintClosure"), 0, NULL);
- Dart_Handle url = NewString(kInternalLibURL);
+ url = NewString(kInternalLibURL);
DART_CHECK_VALID(url);
Dart_Handle internal_lib = Dart_LookupLibrary(url);
DART_CHECK_VALID(internal_lib);
- Dart_Handle result = Dart_SetField(internal_lib,
- NewString("_printClosure"),
- print);
+ result = Dart_SetField(internal_lib,
+ NewString("_printClosure"),
+ print);
DART_CHECK_VALID(result);
// Setup the 'timer' factory.
- url = NewString(kAsyncLibURL);
- DART_CHECK_VALID(url);
- Dart_Handle async_lib = Dart_LookupLibrary(url);
- DART_CHECK_VALID(async_lib);
- Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
-
- // We need to ensure that all the scripts loaded so far are finalized
- // as we are about to invoke some Dart code below to setup closures.
- result = Dart_FinalizeLoading(false);
- DART_CHECK_VALID(result);
-
Dart_Handle timer_closure =
Dart_Invoke(io_lib, NewString("_getTimerFactoryClosure"), 0, NULL);
Dart_Handle args[1];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698