Chromium Code Reviews| Index: runtime/include/dart_api.h |
| =================================================================== |
| --- runtime/include/dart_api.h (revision 1230) |
| +++ runtime/include/dart_api.h (working copy) |
| @@ -131,6 +131,35 @@ |
| // TODO(turnidge): Accept printf-style args here. |
| /** |
| + * Converts an object to a string. |
| + * |
| + * If an exception occurs during the conversion, this is treated as an |
| + * error. |
| + * |
| + * \return A handle to the converted string if no errors occur during |
| + * the conversion. If an error does occur, an invalid handle is |
| + * returned. |
| + */ |
| +DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object); |
| + |
| +/** |
| + * Checks if the two objects are the same object |
| + * |
| + * The result of the comparison is returned through the 'identical' |
|
Ivan Posva
2011/11/07 23:48:30
identical -> same
turnidge
2011/11/10 20:30:58
Done.
|
| + * parameter. The return value itself is used to indicate success or |
| + * failure, not identity. |
| + * |
| + * \param obj1 An object to be compared. |
| + * \param obj2 An object to be compared. |
| + * \param equal Returns the result of the equality comparison. |
|
Ivan Posva
2011/11/07 23:48:30
equal -> same
turnidge
2011/11/10 20:30:58
Done.
|
| + * |
| + * \return A valid handle if no error occurs during the comparison. |
| + */ |
| +DART_EXPORT Dart_Handle Dart_IsSame(Dart_Handle obj1, |
| + Dart_Handle obj2, |
| + bool* same); |
| + |
| +/** |
| * Allocates a persistent handle for an object. |
| * |
| * This handle has the lifetime of the current isolate unless it is |
| @@ -452,21 +481,8 @@ |
| DART_EXPORT bool Dart_IsNull(Dart_Handle object); |
| /** |
| - * Converts an object to a string. |
| + * Checks if the two objects are equal. |
| * |
| - * If an exception occurs during the conversion, this is treated as an |
| - * error. |
| - * |
| - * \return A handle to the converted string if no errors occur during |
| - * the conversion. If an error does occur, an invalid handle is |
| - * returned. |
| - */ |
| -DART_EXPORT Dart_Handle Dart_ObjectToString(Dart_Handle object); |
| -// TODO(turnidge): Consider shortening name to Dart_ToString. |
| - |
| -/** |
| - * Returns true if the two objects are equal. |
| - * |
| * The result of the comparison is returned through the 'equal' |
| * parameter. The return value itself is used to indicate success or |
| * failure, not equality. |
| @@ -477,12 +493,9 @@ |
| * |
| * \return A valid handle if no error occurs during the comparison. |
| */ |
| -DART_EXPORT Dart_Handle Dart_Objects_Equal(Dart_Handle obj1, |
| - Dart_Handle obj2, |
| - bool* equal); |
| -// TODO(turnidge): Consider renaming for consistency. Maybe just |
| -// Dart_Equals. |
| -// TODO(turnidge): Need to add identity equality function. |
| +DART_EXPORT Dart_Handle Dart_ObjectEquals(Dart_Handle obj1, |
| + Dart_Handle obj2, |
| + bool* equal); |
| /** |
| * Is this object an instance of some type? |
| @@ -496,7 +509,7 @@ |
| * |
| * \return A valid handle if no error occurs during the operation. |
| */ |
| -DART_EXPORT Dart_Handle Dart_IsInstanceOf(Dart_Handle object, |
| +DART_EXPORT Dart_Handle Dart_ObjectIsType(Dart_Handle object, |
| Dart_Handle type, |
| bool* instanceof); |
| @@ -1011,9 +1024,8 @@ |
| * \return An invalid handle if the exception was not thrown. |
| * Otherwise the function does not return. |
| */ |
| -DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception, |
| +DART_EXPORT Dart_Handle Dart_RethrowException(Dart_Handle exception, |
| Dart_Handle stacktrace); |
| -// TODO(turnidge): ReThrow -> Rethrow. |
| // --- Native functions --- |