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

Unified Diff: runtime/lib/lib_prefix.dart

Issue 419103003: Handle load errors in deferred code (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 | « runtime/include/dart_api.h ('k') | runtime/lib/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/lib_prefix.dart
===================================================================
--- runtime/lib/lib_prefix.dart (revision 38794)
+++ runtime/lib/lib_prefix.dart (working copy)
@@ -9,6 +9,7 @@
class _LibraryPrefix {
bool _load() native "LibraryPrefix_load";
+ Error _loadError() native "LibraryPrefix_loadError";
bool _invalidateDependentCode()
native "LibraryPrefix_invalidateDependentCode";
@@ -43,10 +44,14 @@
// Called from the VM when all outstanding load requests have
// finished.
_completeDeferredLoads() {
- var lenghth = _outstandingLoadRequests;
_outstandingLoadRequests.forEach((prefix, completer) {
- prefix._invalidateDependentCode();
- completer.complete(true);
+ var error = prefix._loadError();
+ if (error != null) {
+ completer.completeError(error);
+ } else {
+ prefix._invalidateDependentCode();
+ completer.complete(true);
+ }
});
_outstandingLoadRequests.clear();
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/lib/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698