| 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 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 static void ReThrow(const Instance& exception, const Instance& stacktrace); | 21 static void ReThrow(const Instance& exception, const Instance& stacktrace); |
| 22 | 22 |
| 23 enum ExceptionType { | 23 enum ExceptionType { |
| 24 kIndexOutOfRange, | 24 kIndexOutOfRange, |
| 25 kIllegalArgument, | 25 kIllegalArgument, |
| 26 kNoSuchMethod, | 26 kNoSuchMethod, |
| 27 kClosureArgumentMismatch, | 27 kClosureArgumentMismatch, |
| 28 kObjectNotClosure, | 28 kObjectNotClosure, |
| 29 kBadNumberFormat, | 29 kBadNumberFormat, |
| 30 kStackOverflow, | 30 kStackOverflow, |
| 31 kOutOfMemory, |
| 31 kWrongArgumentCount, | 32 kWrongArgumentCount, |
| 32 kInternalError, | 33 kInternalError, |
| 33 kNullPointer, | 34 kNullPointer, |
| 34 kIllegalJSRegExp, | 35 kIllegalJSRegExp, |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 static void ThrowByType(ExceptionType type, | 38 static void ThrowByType(ExceptionType type, |
| 38 const GrowableArray<const Object*>& arguments); | 39 const GrowableArray<const Object*>& arguments); |
| 39 static RawInstance* Create(ExceptionType type, | 40 static RawInstance* Create(ExceptionType type, |
| 40 const GrowableArray<const Object*>& arguments); | 41 const GrowableArray<const Object*>& arguments); |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(Exceptions); | 44 DISALLOW_COPY_AND_ASSIGN(Exceptions); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 } // namespace dart | 47 } // namespace dart |
| 47 | 48 |
| 48 #endif // VM_EXCEPTIONS_H_ | 49 #endif // VM_EXCEPTIONS_H_ |
| OLD | NEW |