Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: include/dart_api.h

Issue 9616044: Adds new apis Dart_GetField/Dart_SetField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/isolate.cc » ('j') | vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | lib/isolate.cc » ('j') | vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698