Chromium Code Reviews| Index: include/dart_api.h |
| =================================================================== |
| --- include/dart_api.h (revision 4977) |
| +++ include/dart_api.h (working copy) |
| @@ -1615,16 +1615,63 @@ |
| Dart_Handle* arguments); |
| /** |
| - * Gets the value of a static field. |
| + * Gets the value of a field. |
| * |
| + * The 'container' parameter may actually be an object, class, or |
| + * library. If 'container' is an object, then this function will |
| + * access an instance field. If 'container' is a class, then this |
| + * function will access a static field. If 'container' is a library, |
| + * then this function will access a top-level variable. |
| + * |
| + * This function ignores field visibility (underscores in names). |
|
Ivan Posva
2012/03/07 20:02:58
leading underscores
turnidge
2012/03/07 21:17:12
Done.
|
| + * |
| * May generate an unhandled exception error. |
| * |
| + * \param container An object, class, or library. |
| + * \param name A field name |
| + * |
| * \return If no error occurs, then the value of the field is |
| * returned. Otherwise an error handle is returned. |
| */ |
| -DART_EXPORT Dart_Handle Dart_GetStaticField(Dart_Handle cls, Dart_Handle name); |
| +DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, |
| + Dart_Handle name); |
| /** |
| + * Sets the value of a field. |
| + * |
| + * The 'container' parameter may actually be an object, class, or |
| + * library. If 'container' is an object, then this function will |
| + * access an instance field. If 'container' is a class, then this |
| + * function will access a static field. If 'container' is a library, |
| + * then this function will access a top-level variable. |
| + * |
| + * May generate an unhandled exception error. |
| + * |
| + * \param container An object, class, or library. |
| + * \param name A field name |
| + * \param value The new field value |
| + * |
| + * \return A valid handle if no error occurs. |
| + */ |
| +DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, |
|
Ivan Posva
2012/03/07 20:02:58
Please document that this also ignores privacy.
turnidge
2012/03/07 21:17:12
Done.
|
| + Dart_Handle name, |
| + Dart_Handle value); |
| + |
| +/** |
| + * DEPRECATED: Use Dart_SetField/Dart_GetField instead. |
| + * |
| + * Gets the value of a static field. |
| + * |
| + * May generate an unhandled exception error. |
| + * |
| + * \return If no error occurs, then the value of the field is |
| + * returned. Otherwise an error handle is returned. |
| + */ |
| +DART_EXPORT Dart_Handle Dart_GetStaticField(Dart_Handle cls, |
| + Dart_Handle name); |
| +/** |
| + * DEPRECATED: Use Dart_SetField/Dart_GetField instead. |
| + * |
| * Sets the value of a static field. |
| * |
| * May generate an unhandled exception error. |
| @@ -1636,6 +1683,8 @@ |
| Dart_Handle value); |
| /** |
| + * DEPRECATED: Use Dart_SetField/Dart_GetField instead. |
| + * |
| * Gets the value of an instance field. |
| * |
| * May generate an unhandled exception error. |
| @@ -1646,6 +1695,8 @@ |
| DART_EXPORT Dart_Handle Dart_GetInstanceField(Dart_Handle obj, |
| Dart_Handle name); |
| /** |
| + * DEPRECATED: Use Dart_SetField/Dart_GetField instead. |
| + * |
| * Sets the value of an instance field. |
| * |
| * May generate an unhandled exception error. |