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 INCLUDE_DART_API_H_ | 5 #ifndef INCLUDE_DART_API_H_ |
6 #define INCLUDE_DART_API_H_ | 6 #define INCLUDE_DART_API_H_ |
7 | 7 |
8 /** \mainpage Dart Embedding API Reference | 8 /** \mainpage Dart Embedding API Reference |
9 * | 9 * |
10 * Dart is a class-based programming language for creating structured | 10 * Dart is a class-based programming language for creating structured |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 | 133 |
134 /** | 134 /** |
135 * Produces an error handle with the provided error message. | 135 * Produces an error handle with the provided error message. |
136 * | 136 * |
137 * Requires there to be a current isolate. | 137 * Requires there to be a current isolate. |
138 * | 138 * |
139 * \param error A C string containing an error message. | 139 * \param error A C string containing an error message. |
140 */ | 140 */ |
141 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...); | 141 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...); |
142 | 142 |
143 /** | |
144 * Propagates an error. | |
145 * | |
146 * It only makes sense to call this function when there are dart | |
147 * frames on the stack. That is, this function should only be called | |
148 * in the C implementation of a native function which has been called | |
149 * from Dart code. If this function is called in the top-level | |
150 * embedder code, it will return an error, as there is no way to | |
151 * further propagate the error. | |
152 * | |
153 * If the error handle represents an unhandled exception, this | |
siva
2012/01/31 00:52:34
if the handle or error handle?
turnidge
2012/01/31 21:56:31
Rewrote the comment a bit.
| |
154 * function will cause the unhandled exception to be rethrown. | |
155 * Otherwise, this function will cause the stack to be an unwound, | |
156 * discarding any dart frames up to the next C frame. | |
157 * | |
158 * \return On success, this function does not return. On failure, an | |
159 * error handle is returned. | |
160 */ | |
161 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle); | |
162 | |
143 // Internal routine used for reporting error handles. | 163 // Internal routine used for reporting error handles. |
144 DART_EXPORT void _Dart_ReportErrorHandle(const char* file, | 164 DART_EXPORT void _Dart_ReportErrorHandle(const char* file, |
145 int line, | 165 int line, |
146 const char* handle_string, | 166 const char* handle_string, |
147 const char* error); | 167 const char* error); |
148 | 168 |
149 // TODO(turnidge): Move DART_CHECK_VALID to some sort of dart_utils | 169 // TODO(turnidge): Move DART_CHECK_VALID to some sort of dart_utils |
150 // header instead of this header. | 170 // header instead of this header. |
151 /** | 171 /** |
152 * Aborts the process if 'handle' is an error handle. | 172 * Aborts the process if 'handle' is an error handle. |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1384 | 1404 |
1385 // --- Profiling support ---- | 1405 // --- Profiling support ---- |
1386 | 1406 |
1387 // External pprof support for gathering and dumping symbolic | 1407 // External pprof support for gathering and dumping symbolic |
1388 // information that can be used for better profile reports for | 1408 // information that can be used for better profile reports for |
1389 // dynamically generated code. | 1409 // dynamically generated code. |
1390 DART_EXPORT void Dart_InitPprofSupport(); | 1410 DART_EXPORT void Dart_InitPprofSupport(); |
1391 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1411 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
1392 | 1412 |
1393 #endif // INCLUDE_DART_API_H_ | 1413 #endif // INCLUDE_DART_API_H_ |
OLD | NEW |