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

Unified Diff: runtime/bin/dartutils.cc

Issue 88783002: Isolate.spawn{Uri} only reports errors asynchronously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dart2js. Created 7 years, 1 month 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/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 1c1277b274da8c0eb8bf2c20d56ad235ee34d023..93f7b10ec043e08fffdaaedf75e7664fbf32228e 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -27,6 +27,8 @@ const char* DartUtils::kDartExtensionScheme = "dart-ext:";
const char* DartUtils::kAsyncLibURL = "dart:async";
const char* DartUtils::kBuiltinLibURL = "dart:builtin";
const char* DartUtils::kCoreLibURL = "dart:core";
+const char* DartUtils::kIsolateLibURL = "dart:isolate";
+const char* DartUtils::kInternalLibURL = "dart:_collection-dev";
const char* DartUtils::kIOLibURL = "dart:io";
const char* DartUtils::kIOLibPatchURL = "dart:io-patch";
const char* DartUtils::kUriLibURL = "dart:uri";
@@ -667,8 +669,9 @@ Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping,
Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
Dart_Handle builtin_lib) {
// Setup the internal library's 'internalPrint' function.
- Dart_Handle internal_lib =
- Dart_LookupLibrary(NewString("dart:_collection-dev"));
+ Dart_Handle url = NewString(kInternalLibURL);
+ DART_CHECK_VALID(url);
+ Dart_Handle internal_lib = Dart_LookupLibrary(url);
DART_CHECK_VALID(internal_lib);
Dart_Handle print = Dart_Invoke(
builtin_lib, NewString("_getPrintClosure"), 0, NULL);
@@ -678,7 +681,7 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
DART_CHECK_VALID(result);
// Setup the 'timer' factory.
- Dart_Handle url = NewString(kAsyncLibURL);
+ url = NewString(kAsyncLibURL);
DART_CHECK_VALID(url);
Dart_Handle async_lib = Dart_LookupLibrary(url);
DART_CHECK_VALID(async_lib);
@@ -690,8 +693,22 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
DART_CHECK_VALID(Dart_Invoke(
async_lib, NewString("_setTimerFactoryClosure"), 1, args));
+ // Setup the 'scheduleImmediate' closure.
+ url = NewString(kIsolateLibURL);
+ DART_CHECK_VALID(url);
+ Dart_Handle isolate_lib = Dart_LookupLibrary(url);
+ DART_CHECK_VALID(isolate_lib);
+ Dart_Handle schedule_immediate_closure =
+ Dart_Invoke(isolate_lib, NewString("_getIsolateScheduleImmediateClosure"),
+ 0, NULL);
+ args[0] = schedule_immediate_closure;
+ DART_CHECK_VALID(Dart_Invoke(
+ internal_lib, NewString("setScheduleImmediateClosure"), 1, args));
+
// Setup the corelib 'Uri.base' getter.
- Dart_Handle corelib = Dart_LookupLibrary(NewString("dart:core"));
+ url = NewString(kCoreLibURL);
+ DART_CHECK_VALID(url);
+ Dart_Handle corelib = Dart_LookupLibrary(url);
DART_CHECK_VALID(corelib);
Dart_Handle uri_base = Dart_Invoke(
builtin_lib, NewString("_getUriBaseClosure"), 0, NULL);

Powered by Google App Engine
This is Rietveld 408576698