| 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 "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
| 8 #include "vm/heap.h" | 8 #include "vm/heap.h" |
| 9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } else { | 180 } else { |
| 181 type_name = type.UserVisibleName(); | 181 type_name = type.UserVisibleName(); |
| 182 } | 182 } |
| 183 String& malformed_error_message = String::Handle(); | 183 String& malformed_error_message = String::Handle(); |
| 184 if (malformed_error.IsNull()) { | 184 if (malformed_error.IsNull()) { |
| 185 const String& dst_name = String::ZoneHandle( | 185 const String& dst_name = String::ZoneHandle( |
| 186 Symbols::New(Exceptions::kCastErrorDstName)); | 186 Symbols::New(Exceptions::kCastErrorDstName)); |
| 187 | 187 |
| 188 Exceptions::CreateAndThrowTypeError( | 188 Exceptions::CreateAndThrowTypeError( |
| 189 location, instance_type_name, type_name, | 189 location, instance_type_name, type_name, |
| 190 dst_name, String::Handle()); | 190 dst_name, Object::null_string()); |
| 191 } else { | 191 } else { |
| 192 ASSERT(FLAG_enable_type_checks); | 192 ASSERT(FLAG_enable_type_checks); |
| 193 malformed_error_message = String::New(malformed_error.ToErrorCString()); | 193 malformed_error_message = String::New(malformed_error.ToErrorCString()); |
| 194 Exceptions::CreateAndThrowTypeError( | 194 Exceptions::CreateAndThrowTypeError( |
| 195 location, instance_type_name, Symbols::Empty(), | 195 location, instance_type_name, Symbols::Empty(), |
| 196 Symbols::Empty(), malformed_error_message); | 196 Symbols::Empty(), malformed_error_message); |
| 197 } | 197 } |
| 198 UNREACHABLE(); | 198 UNREACHABLE(); |
| 199 } | 199 } |
| 200 return instance.raw(); | 200 return instance.raw(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 | 203 |
| 204 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { | 204 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { |
| 205 const AbstractType& type = | 205 const AbstractType& type = |
| 206 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); | 206 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); |
| 207 return type.UserVisibleName(); | 207 return type.UserVisibleName(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace dart | 210 } // namespace dart |
| OLD | NEW |