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

Side by Side Diff: runtime/vm/bootstrap.cc

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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap.h" 5 #include "vm/bootstrap.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bootstrap_natives.h" 9 #include "vm/bootstrap_natives.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 bool update_lib_status = (script.kind() == RawScript::kScriptTag || 143 bool update_lib_status = (script.kind() == RawScript::kScriptTag ||
144 script.kind() == RawScript::kLibraryTag); 144 script.kind() == RawScript::kLibraryTag);
145 if (update_lib_status) { 145 if (update_lib_status) {
146 library.SetLoadInProgress(); 146 library.SetLoadInProgress();
147 } 147 }
148 const Error& error = Error::Handle(Compiler::Compile(library, script)); 148 const Error& error = Error::Handle(Compiler::Compile(library, script));
149 if (update_lib_status) { 149 if (update_lib_status) {
150 if (error.IsNull()) { 150 if (error.IsNull()) {
151 library.SetLoaded(); 151 library.SetLoaded();
152 } else { 152 } else {
153 library.SetLoadError(); 153 library.SetLoadError(error);
154 } 154 }
155 } 155 }
156 return error.raw(); 156 return error.raw();
157 } 157 }
158 158
159 159
160 static Dart_Handle LoadPartSource(Isolate* isolate, 160 static Dart_Handle LoadPartSource(Isolate* isolate,
161 const Library& lib, 161 const Library& lib,
162 const String& uri) { 162 const String& uri) {
163 const String& part_source = String::Handle( 163 const String& part_source = String::Handle(
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 ClassFinalizer::ProcessPendingClasses(); 315 ClassFinalizer::ProcessPendingClasses();
316 } 316 }
317 317
318 // Restore the library tag handler for the isolate. 318 // Restore the library tag handler for the isolate.
319 isolate->set_library_tag_handler(saved_tag_handler); 319 isolate->set_library_tag_handler(saved_tag_handler);
320 320
321 return error.raw(); 321 return error.raw();
322 } 322 }
323 323
324 } // namespace dart 324 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698