OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |