| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception); | 276 DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception); |
| 277 | 277 |
| 278 // Deprecated. | 278 // Deprecated. |
| 279 // TODO(turnidge): Remove all uses and delete. | 279 // TODO(turnidge): Remove all uses and delete. |
| 280 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...); | 280 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...); |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * Propagates an error. | 283 * Propagates an error. |
| 284 * | 284 * |
| 285 * If the provided handle is an unhandled exception error, this | 285 * If the provided handle is an unhandled exception error, this |
| 286 * function will cause the unhandled exception to be rethrown. | 286 * function will cause the unhandled exception to be rethrown. This |
| 287 * will proceeed in the standard way, walking up Dart frames until an |
| 288 * appropriate 'catch' block is found, executing 'finally' blocks, |
| 289 * etc. |
| 287 * | 290 * |
| 288 * If the error is not an unhandled exception error, we will unwind | 291 * If the error is not an unhandled exception error, we will unwind |
| 289 * the stack to the next C frame. Any intervening Dart frames will | 292 * the stack to the next C frame. Intervening Dart frames will be |
| 290 * be discarded. | 293 * discarded; specifically, 'finally' blocks will not execute. This |
| 294 * is the standard way that compilation errors (and the like) are |
| 295 * handled by the Dart runtime. |
| 291 * | 296 * |
| 292 * In either case, when an error is propagated any current scopes | 297 * In either case, when an error is propagated any current scopes |
| 293 * created by Dart_EnterScope will be exited. | 298 * created by Dart_EnterScope will be exited. |
| 294 * | 299 * |
| 295 * See the additonal discussion under "Propagating Errors" at the | 300 * See the additonal discussion under "Propagating Errors" at the |
| 296 * beginning of this file. | 301 * beginning of this file. |
| 297 * | 302 * |
| 298 * \param An error handle (See Dart_IsError) | 303 * \param An error handle (See Dart_IsError) |
| 299 * | 304 * |
| 300 * \return On success, this function does not return. On failure, an | 305 * \return On success, this function does not return. On failure, an |
| (...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 int index, | 2350 int index, |
| 2346 intptr_t value); | 2351 intptr_t value); |
| 2347 | 2352 |
| 2348 // --- Exceptions ---- | 2353 // --- Exceptions ---- |
| 2349 // TODO(turnidge): Remove these functions from the api and replace all | 2354 // TODO(turnidge): Remove these functions from the api and replace all |
| 2350 // uses with Dart_NewUnhandledExceptionError. | 2355 // uses with Dart_NewUnhandledExceptionError. |
| 2351 | 2356 |
| 2352 /** | 2357 /** |
| 2353 * Throws an exception. | 2358 * Throws an exception. |
| 2354 * | 2359 * |
| 2355 * Throws an exception, unwinding all dart frames on the stack. If | 2360 * This function causes a Dart language exception to be thrown. This |
| 2356 * successful, this function does not return. Note that this means | 2361 * will proceeed in the standard way, walking up Dart frames until an |
| 2362 * appropriate 'catch' block is found, executing 'finally' blocks, |
| 2363 * etc. |
| 2364 * |
| 2365 * If successful, this function does not return. Note that this means |
| 2357 * that the destructors of any stack-allocated C++ objects will not be | 2366 * that the destructors of any stack-allocated C++ objects will not be |
| 2358 * called. If there are no Dart frames on the stack, an error occurs. | 2367 * called. If there are no Dart frames on the stack, an error occurs. |
| 2359 * | 2368 * |
| 2360 * \return An error handle if the exception was not thrown. | 2369 * \return An error handle if the exception was not thrown. |
| 2361 * Otherwise the function does not return. | 2370 * Otherwise the function does not return. |
| 2362 */ | 2371 */ |
| 2363 DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception); | 2372 DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception); |
| 2364 | 2373 |
| 2365 /** | 2374 /** |
| 2366 * Rethrows an exception. | 2375 * Rethrows an exception. |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2606 | 2615 |
| 2607 typedef void (*Dart_FileWriterFunction)(const char* buffer, int64_t num_bytes); | 2616 typedef void (*Dart_FileWriterFunction)(const char* buffer, int64_t num_bytes); |
| 2608 | 2617 |
| 2609 // Support for generating symbol maps for use by the Linux perf tool. | 2618 // Support for generating symbol maps for use by the Linux perf tool. |
| 2610 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function); | 2619 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function); |
| 2611 | 2620 |
| 2612 // Support for generating flow graph compiler debugging output into a file. | 2621 // Support for generating flow graph compiler debugging output into a file. |
| 2613 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function); | 2622 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function); |
| 2614 | 2623 |
| 2615 #endif // INCLUDE_DART_API_H_ | 2624 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |