| 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 "lib/error.h" | 5 #include "lib/error.h" |
| 6 | 6 |
| 7 #include "vm/bootstrap_natives.h" | 7 #include "vm/bootstrap_natives.h" |
| 8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Throw TypeError instance. | 149 // Throw TypeError instance. |
| 150 Exceptions::Throw(type_error); | 150 Exceptions::Throw(type_error); |
| 151 UNREACHABLE(); | 151 UNREACHABLE(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 | 154 |
| 155 // Allocate and throw a new FallThroughError. | 155 // Allocate and throw a new FallThroughError. |
| 156 // Arg0: index of the case clause token into which we fall through. | 156 // Arg0: index of the case clause token into which we fall through. |
| 157 // Return value: none, throws an exception. | 157 // Return value: none, throws an exception. |
| 158 DEFINE_NATIVE_ENTRY(FallThroughError_throwNew, 1) { | 158 DEFINE_NATIVE_ENTRY(FallThroughError_throwNew, 1) { |
| 159 intptr_t fallthrough_pos = Smi::CheckedHandle(arguments->At(0)).Value(); | 159 GET_NATIVE_ARGUMENT(Smi, smi_pos, arguments->At(0)); |
| 160 intptr_t fallthrough_pos = smi_pos.Value(); |
| 160 | 161 |
| 161 // Allocate a new instance of type FallThroughError. | 162 // Allocate a new instance of type FallThroughError. |
| 162 const Instance& fallthrough_error = | 163 const Instance& fallthrough_error = |
| 163 Instance::Handle(NewInstance("FallThroughError")); | 164 Instance::Handle(NewInstance("FallThroughError")); |
| 164 ASSERT(!fallthrough_error.IsNull()); | 165 ASSERT(!fallthrough_error.IsNull()); |
| 165 | 166 |
| 166 // Initialize 'url' and 'line' fields. | 167 // Initialize 'url' and 'line' fields. |
| 167 DartFrameIterator iterator; | 168 DartFrameIterator iterator; |
| 168 iterator.NextFrame(); // Skip native call. | 169 iterator.NextFrame(); // Skip native call. |
| 169 const Script& script = Script::Handle(GetCallerScript(&iterator)); | 170 const Script& script = Script::Handle(GetCallerScript(&iterator)); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 dst_type_name = element_type.Name(); | 279 dst_type_name = element_type.Name(); |
| 279 } | 280 } |
| 280 const String& dst_name = String::Handle(String::New(buf)); | 281 const String& dst_name = String::Handle(String::New(buf)); |
| 281 ThrowTypeError(location, src_type_name, dst_type_name, dst_name); | 282 ThrowTypeError(location, src_type_name, dst_type_name, dst_name); |
| 282 UNREACHABLE(); | 283 UNREACHABLE(); |
| 283 } | 284 } |
| 284 } | 285 } |
| 285 } | 286 } |
| 286 | 287 |
| 287 } // namespace dart | 288 } // namespace dart |
| OLD | NEW |