| 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 #ifndef VM_EXCEPTIONS_H_ | 5 #ifndef VM_EXCEPTIONS_H_ |
| 6 #define VM_EXCEPTIONS_H_ | 6 #define VM_EXCEPTIONS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class Stacktrace; | 27 class Stacktrace; |
| 28 class String; | 28 class String; |
| 29 | 29 |
| 30 class Exceptions : AllStatic { | 30 class Exceptions : AllStatic { |
| 31 public: | 31 public: |
| 32 static const char* kCastErrorDstName; | 32 static const char* kCastErrorDstName; |
| 33 | 33 |
| 34 static void Throw(Isolate* isolate, const Instance& exception); | 34 static void Throw(Isolate* isolate, const Instance& exception); |
| 35 static void ReThrow(Isolate* isolate, | 35 static void ReThrow(Isolate* isolate, |
| 36 const Instance& exception, | 36 const Instance& exception, |
| 37 const Stacktrace& stacktrace); | 37 const Instance& stacktrace); |
| 38 static void PropagateError(const Error& error); | 38 static void PropagateError(const Error& error); |
| 39 | 39 |
| 40 // Helpers to create and throw errors. | 40 // Helpers to create and throw errors. |
| 41 static RawStacktrace* CurrentStacktrace(); | 41 static RawStacktrace* CurrentStacktrace(); |
| 42 static RawScript* GetCallerScript(DartFrameIterator* iterator); | 42 static RawScript* GetCallerScript(DartFrameIterator* iterator); |
| 43 static RawInstance* NewInstance(const char* class_name); | 43 static RawInstance* NewInstance(const char* class_name); |
| 44 static void CreateAndThrowTypeError(intptr_t location, | 44 static void CreateAndThrowTypeError(intptr_t location, |
| 45 const String& src_type_name, | 45 const String& src_type_name, |
| 46 const String& dst_type_name, | 46 const String& dst_type_name, |
| 47 const String& dst_name, | 47 const String& dst_name, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // otherwise returns a RawError. | 83 // otherwise returns a RawError. |
| 84 static RawObject* Create(ExceptionType type, const Array& arguments); | 84 static RawObject* Create(ExceptionType type, const Array& arguments); |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 DISALLOW_COPY_AND_ASSIGN(Exceptions); | 87 DISALLOW_COPY_AND_ASSIGN(Exceptions); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace dart | 90 } // namespace dart |
| 91 | 91 |
| 92 #endif // VM_EXCEPTIONS_H_ | 92 #endif // VM_EXCEPTIONS_H_ |
| OLD | NEW |