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 class RawStacktrace; | 21 class RawStacktrace; |
22 class RawObject; | 22 class RawObject; |
23 class Script; | 23 class Script; |
24 class StackFrame; | 24 class StackFrame; |
25 class String; | 25 class String; |
26 | 26 |
27 class Exceptions : AllStatic { | 27 class Exceptions : AllStatic { |
28 public: | 28 public: |
29 static const char* kCastErrorDstName; | 29 static const char* kCastErrorDstName; |
30 | 30 |
31 static void Throw(const Instance& exception); | 31 static void Throw(Isolate* isolate, const Instance& exception); |
32 static void ReThrow(const Instance& exception, const Instance& stacktrace); | 32 static void ReThrow(Isolate* isolate, |
| 33 const Instance& exception, |
| 34 const Instance& stacktrace); |
33 static void PropagateError(const Error& error); | 35 static void PropagateError(const Error& error); |
34 | 36 |
35 // Report a Javascript compatibility warning at the call site given by | 37 // Report a Javascript compatibility warning at the call site given by |
36 // caller_frame. Note that a JavascriptCompatibilityError is thrown | 38 // caller_frame. Note that a JavascriptCompatibilityError is thrown |
37 // if --warning_as_error is specified. | 39 // if --warning_as_error is specified. |
38 // Also calls TraceJSWarningV below. | 40 // Also calls TraceJSWarningV below. |
39 static void JSWarning(StackFrame* caller_frame, const char* format, ...) | 41 static void JSWarning(StackFrame* caller_frame, const char* format, ...) |
40 PRINTF_ATTRIBUTE(2, 3); | 42 PRINTF_ATTRIBUTE(2, 3); |
41 | 43 |
42 // Emit a Javascript compatibility warning to the current trace buffer. | 44 // Emit a Javascript compatibility warning to the current trace buffer. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // otherwise returns a RawError. | 90 // otherwise returns a RawError. |
89 static RawObject* Create(ExceptionType type, const Array& arguments); | 91 static RawObject* Create(ExceptionType type, const Array& arguments); |
90 | 92 |
91 private: | 93 private: |
92 DISALLOW_COPY_AND_ASSIGN(Exceptions); | 94 DISALLOW_COPY_AND_ASSIGN(Exceptions); |
93 }; | 95 }; |
94 | 96 |
95 } // namespace dart | 97 } // namespace dart |
96 | 98 |
97 #endif // VM_EXCEPTIONS_H_ | 99 #endif // VM_EXCEPTIONS_H_ |
OLD | NEW |