| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 const char* handle_string, | 320 const char* handle_string, |
| 321 const char* error); | 321 const char* error); |
| 322 | 322 |
| 323 // TODO(turnidge): Move DART_CHECK_VALID to some sort of dart_utils | 323 // TODO(turnidge): Move DART_CHECK_VALID to some sort of dart_utils |
| 324 // header instead of this header. | 324 // header instead of this header. |
| 325 /** | 325 /** |
| 326 * Aborts the process if 'handle' is an error handle. | 326 * Aborts the process if 'handle' is an error handle. |
| 327 * | 327 * |
| 328 * Provided for convenience. | 328 * Provided for convenience. |
| 329 */ | 329 */ |
| 330 #define DART_CHECK_VALID(handle) \ | 330 #define DART_CHECK_VALID(handle) \ |
| 331 if (Dart_IsError((handle))) { \ | 331 { \ |
| 332 _Dart_ReportErrorHandle(__FILE__, __LINE__, \ | 332 Dart_Handle __handle = handle; \ |
| 333 #handle, Dart_GetError(handle)); \ | 333 if (Dart_IsError((__handle))) { \ |
| 334 } | 334 _Dart_ReportErrorHandle(__FILE__, __LINE__, \ |
| 335 #handle, Dart_GetError(__handle)); \ |
| 336 } \ |
| 337 } \ |
| 335 | 338 |
| 336 | 339 |
| 337 /** | 340 /** |
| 338 * Converts an object to a string. | 341 * Converts an object to a string. |
| 339 * | 342 * |
| 340 * May generate an unhandled exception error. | 343 * May generate an unhandled exception error. |
| 341 * | 344 * |
| 342 * \return The converted string if no error occurs during | 345 * \return The converted string if no error occurs during |
| 343 * the conversion. If an error does occur, an error handle is | 346 * the conversion. If an error does occur, an error handle is |
| 344 * returned. | 347 * returned. |
| (...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2562 * | 2565 * |
| 2563 * \param object An object. | 2566 * \param object An object. |
| 2564 * \param peer A value to store in the peer field. | 2567 * \param peer A value to store in the peer field. |
| 2565 * | 2568 * |
| 2566 * \return Returns an error if 'object' is a subtype of Null, num, or | 2569 * \return Returns an error if 'object' is a subtype of Null, num, or |
| 2567 * bool. | 2570 * bool. |
| 2568 */ | 2571 */ |
| 2569 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2572 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
| 2570 | 2573 |
| 2571 #endif // INCLUDE_DART_API_H_ | 2574 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |