Chromium Code Reviews| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 /** | 454 /** |
| 455 * Converts an object to a string. | 455 * Converts an object to a string. |
| 456 * | 456 * |
| 457 * If an exception occurs during the conversion, this is treated as an | 457 * If an exception occurs during the conversion, this is treated as an |
| 458 * error. | 458 * error. |
| 459 * | 459 * |
| 460 * \return A handle to the converted string if no errors occur during | 460 * \return A handle to the converted string if no errors occur during |
| 461 * the conversion. If an error does occur, an invalid handle is | 461 * the conversion. If an error does occur, an invalid handle is |
| 462 * returned. | 462 * returned. |
| 463 */ | 463 */ |
| 464 DART_EXPORT Dart_Handle Dart_ObjectToString(Dart_Handle object); | 464 DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object); |
|
Ivan Posva
2011/11/07 23:10:45
Dart_ToString and Dart_IsSame are functions that s
turnidge
2011/11/07 23:35:19
Moved.
| |
| 465 // TODO(turnidge): Consider shortening name to Dart_ToString. | |
| 466 | 465 |
| 467 /** | 466 /** |
| 468 * Returns true if the two objects are equal. | 467 * Checks if the two objects are equal. |
| 469 * | 468 * |
| 470 * The result of the comparison is returned through the 'equal' | 469 * The result of the comparison is returned through the 'equal' |
| 471 * parameter. The return value itself is used to indicate success or | 470 * parameter. The return value itself is used to indicate success or |
| 472 * failure, not equality. | 471 * failure, not equality. |
| 473 * | 472 * |
| 474 * \param obj1 An object to be compared. | 473 * \param obj1 An object to be compared. |
| 475 * \param obj2 An object to be compared. | 474 * \param obj2 An object to be compared. |
| 476 * \param equal Returns the result of the equality comparison. | 475 * \param equal Returns the result of the equality comparison. |
| 477 * | 476 * |
| 478 * \return A valid handle if no error occurs during the comparison. | 477 * \return A valid handle if no error occurs during the comparison. |
| 479 */ | 478 */ |
| 480 DART_EXPORT Dart_Handle Dart_Objects_Equal(Dart_Handle obj1, | 479 DART_EXPORT Dart_Handle Dart_Equals(Dart_Handle obj1, |
|
Ivan Posva
2011/11/07 23:10:45
This should really be Dart_ObjectEquals to be cons
turnidge
2011/11/07 23:35:19
Done.
| |
| 481 Dart_Handle obj2, | 480 Dart_Handle obj2, |
| 482 bool* equal); | 481 bool* equal); |
| 483 // TODO(turnidge): Consider renaming for consistency. Maybe just | 482 |
| 484 // Dart_Equals. | 483 /** |
| 485 // TODO(turnidge): Need to add identity equality function. | 484 * Checks if the two objects are the same object |
| 485 * | |
| 486 * The result of the comparison is returned through the 'identical' | |
| 487 * parameter. The return value itself is used to indicate success or | |
| 488 * failure, not identity. | |
| 489 * | |
| 490 * \param obj1 An object to be compared. | |
| 491 * \param obj2 An object to be compared. | |
| 492 * \param equal Returns the result of the equality comparison. | |
| 493 * | |
| 494 * \return A valid handle if no error occurs during the comparison. | |
| 495 */ | |
| 496 DART_EXPORT Dart_Handle Dart_TripleEquals(Dart_Handle obj1, | |
|
Ivan Posva
2011/11/07 23:10:45
Dart_IsSame as discussed offline.
turnidge
2011/11/07 23:35:19
Done.
| |
| 497 Dart_Handle obj2, | |
| 498 bool* identical); | |
| 486 | 499 |
| 487 /** | 500 /** |
| 488 * Is this object an instance of some type? | 501 * Is this object an instance of some type? |
| 489 * | 502 * |
| 490 * The result of the test is returned through the 'instanceif' parameter. | 503 * The result of the test is returned through the 'instanceif' parameter. |
| 491 * The return value itself is used to indicate success or failure. | 504 * The return value itself is used to indicate success or failure. |
| 492 * | 505 * |
| 493 * \param object An object. | 506 * \param object An object. |
| 494 * \param type A type. | 507 * \param type A type. |
| 495 * \param instanceof Return true if 'object' is an instance of type 'type'. | 508 * \param instanceof Return true if 'object' is an instance of type 'type'. |
| 496 * | 509 * |
| 497 * \return A valid handle if no error occurs during the operation. | 510 * \return A valid handle if no error occurs during the operation. |
| 498 */ | 511 */ |
| 499 DART_EXPORT Dart_Handle Dart_IsInstanceOf(Dart_Handle object, | 512 DART_EXPORT Dart_Handle Dart_IsType(Dart_Handle object, |
|
Ivan Posva
2011/11/07 23:10:45
Dart_ObjectIsType, again to be consistent.
turnidge
2011/11/07 23:35:19
Done.
| |
| 500 Dart_Handle type, | 513 Dart_Handle type, |
| 501 bool* instanceof); | 514 bool* instanceof); |
| 502 | 515 |
| 503 // --- Numbers ---- | 516 // --- Numbers ---- |
| 504 | 517 |
| 505 /** | 518 /** |
| 506 * Is this object a Number? | 519 * Is this object a Number? |
| 507 */ | 520 */ |
| 508 DART_EXPORT bool Dart_IsNumber(Dart_Handle object); | 521 DART_EXPORT bool Dart_IsNumber(Dart_Handle object); |
| 509 | 522 |
| 510 // --- Integers ---- | 523 // --- Integers ---- |
| 511 | 524 |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1004 * Rethrows an exception. | 1017 * Rethrows an exception. |
| 1005 * | 1018 * |
| 1006 * Rethrows an exception, unwinding all dart frames on the stack. If | 1019 * Rethrows an exception, unwinding all dart frames on the stack. If |
| 1007 * successful, this function does not return. Note that this means | 1020 * successful, this function does not return. Note that this means |
| 1008 * that the destructors of any stack-allocated C++ objects will not be | 1021 * that the destructors of any stack-allocated C++ objects will not be |
| 1009 * called. If there are no Dart frames on the stack, an error occurs. | 1022 * called. If there are no Dart frames on the stack, an error occurs. |
| 1010 * | 1023 * |
| 1011 * \return An invalid handle if the exception was not thrown. | 1024 * \return An invalid handle if the exception was not thrown. |
| 1012 * Otherwise the function does not return. | 1025 * Otherwise the function does not return. |
| 1013 */ | 1026 */ |
| 1014 DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception, | 1027 DART_EXPORT Dart_Handle Dart_RethrowException(Dart_Handle exception, |
| 1015 Dart_Handle stacktrace); | 1028 Dart_Handle stacktrace); |
| 1016 // TODO(turnidge): ReThrow -> Rethrow. | |
| 1017 | 1029 |
| 1018 // --- Native functions --- | 1030 // --- Native functions --- |
| 1019 | 1031 |
| 1020 /** | 1032 /** |
| 1021 * The arguments to a native function. | 1033 * The arguments to a native function. |
| 1022 * | 1034 * |
| 1023 * This object is passed to a native function to represent its | 1035 * This object is passed to a native function to represent its |
| 1024 * arguments and return value. It allows access to the arguments to a | 1036 * arguments and return value. It allows access to the arguments to a |
| 1025 * native function by index. It also allows the return value of a | 1037 * native function by index. It also allows the return value of a |
| 1026 * native function to be set. | 1038 * native function to be set. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1135 | 1147 |
| 1136 // --- Profiling support ---- | 1148 // --- Profiling support ---- |
| 1137 | 1149 |
| 1138 // External pprof support for gathering and dumping symbolic | 1150 // External pprof support for gathering and dumping symbolic |
| 1139 // information that can be used for better profile reports for | 1151 // information that can be used for better profile reports for |
| 1140 // dynamically generated code. | 1152 // dynamically generated code. |
| 1141 DART_EXPORT void Dart_InitPprofSupport(); | 1153 DART_EXPORT void Dart_InitPprofSupport(); |
| 1142 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1154 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1143 | 1155 |
| 1144 #endif // INCLUDE_DART_API_H_ | 1156 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |