| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_natives.h" | 5 #include "vm/bootstrap_natives.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 252 } |
| 253 String& bound_error_message = String::Handle(); | 253 String& bound_error_message = String::Handle(); |
| 254 if (bound_error.IsNull()) { | 254 if (bound_error.IsNull()) { |
| 255 const String& dst_name = String::ZoneHandle( | 255 const String& dst_name = String::ZoneHandle( |
| 256 Symbols::New(Exceptions::kCastErrorDstName)); | 256 Symbols::New(Exceptions::kCastErrorDstName)); |
| 257 | 257 |
| 258 Exceptions::CreateAndThrowTypeError( | 258 Exceptions::CreateAndThrowTypeError( |
| 259 location, instance_type_name, type_name, | 259 location, instance_type_name, type_name, |
| 260 dst_name, Object::null_string()); | 260 dst_name, Object::null_string()); |
| 261 } else { | 261 } else { |
| 262 ASSERT(FLAG_enable_type_checks); | 262 ASSERT(Isolate::Current()->TypeChecksEnabled()); |
| 263 bound_error_message = String::New(bound_error.ToErrorCString()); | 263 bound_error_message = String::New(bound_error.ToErrorCString()); |
| 264 Exceptions::CreateAndThrowTypeError( | 264 Exceptions::CreateAndThrowTypeError( |
| 265 location, instance_type_name, Symbols::Empty(), | 265 location, instance_type_name, Symbols::Empty(), |
| 266 Symbols::Empty(), bound_error_message); | 266 Symbols::Empty(), bound_error_message); |
| 267 } | 267 } |
| 268 UNREACHABLE(); | 268 UNREACHABLE(); |
| 269 } | 269 } |
| 270 return instance.raw(); | 270 return instance.raw(); |
| 271 } | 271 } |
| 272 | 272 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 300 // Currently all errors are Dart instances, e.g. I/O errors | 300 // Currently all errors are Dart instances, e.g. I/O errors |
| 301 // created by deferred loading code. LanguageErrors from | 301 // created by deferred loading code. LanguageErrors from |
| 302 // failed loading or finalization attempts are propagated and result | 302 // failed loading or finalization attempts are propagated and result |
| 303 // in the isolate's death. | 303 // in the isolate's death. |
| 304 const Instance& error = Instance::Handle(prefix.LoadError()); | 304 const Instance& error = Instance::Handle(prefix.LoadError()); |
| 305 return error.raw(); | 305 return error.raw(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 | 308 |
| 309 } // namespace dart | 309 } // namespace dart |
| OLD | NEW |