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

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
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Compilation errors are not Dart instances, so just mark the library
154 // as having failed to load without providing an error instance.
155 library.SetLoadError(Instance::Handle());
154 } 156 }
155 } 157 }
156 return error.raw(); 158 return error.raw();
157 } 159 }
158 160
159 161
160 static Dart_Handle LoadPartSource(Isolate* isolate, 162 static Dart_Handle LoadPartSource(Isolate* isolate,
161 const Library& lib, 163 const Library& lib,
162 const String& uri) { 164 const String& uri) {
163 const String& part_source = String::Handle( 165 const String& part_source = String::Handle(
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 ClassFinalizer::ProcessPendingClasses(); 317 ClassFinalizer::ProcessPendingClasses();
316 } 318 }
317 319
318 // Restore the library tag handler for the isolate. 320 // Restore the library tag handler for the isolate.
319 isolate->set_library_tag_handler(saved_tag_handler); 321 isolate->set_library_tag_handler(saved_tag_handler);
320 322
321 return error.raw(); 323 return error.raw();
322 } 324 }
323 325
324 } // namespace dart 326 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/object.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698