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

Unified Diff: runtime/include/dart_api.h

Issue 17390008: Fix for issue 11262. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
===================================================================
--- runtime/include/dart_api.h (revision 24158)
+++ runtime/include/dart_api.h (working copy)
@@ -1142,8 +1142,8 @@
DART_EXPORT bool Dart_IsExternalString(Dart_Handle object);
DART_EXPORT bool Dart_IsList(Dart_Handle object);
DART_EXPORT bool Dart_IsLibrary(Dart_Handle object);
+DART_EXPORT bool Dart_IsType(Dart_Handle handle);
DART_EXPORT bool Dart_IsClass(Dart_Handle handle);
-DART_EXPORT bool Dart_IsAbstractClass(Dart_Handle handle);
DART_EXPORT bool Dart_IsFunction(Dart_Handle handle);
DART_EXPORT bool Dart_IsVariable(Dart_Handle handle);
DART_EXPORT bool Dart_IsTypeVariable(Dart_Handle handle);
@@ -1165,6 +1165,18 @@
* any functions that more properly belong here. */
/**
+ * Gets the type of a Dart language object.
+ *
+ * \param instance Some Dart object.
+ *
+ * \return If no error occurs, the type is returned. Otherwise an
+ * error handle is returned.
+ */
+DART_EXPORT Dart_Handle Dart_InstanceGetType(Dart_Handle instance);
+
+/**
+ * TODO(asiva): Deprecate this method once all use cases have switched
+ * to using Dart_InstanceGetType
* Gets the class for some Dart language object.
*
* \param instance Some Dart object.
@@ -1736,7 +1748,7 @@
* This function allows hidden constructors (constructors with leading
* underscores) to be called.
*
- * \param clazz A class or an interface.
+ * \param type Type of object to be constructed.
* \param constructor_name The name of the constructor to invoke. Use
* Dart_Null() to invoke the unnamed constructor. This name should
* not include the name of the class.
@@ -1747,7 +1759,7 @@
* then the new object. If an error occurs during execution, then an
* error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_New(Dart_Handle clazz,
+DART_EXPORT Dart_Handle Dart_New(Dart_Handle type,
Dart_Handle constructor_name,
int number_of_arguments,
Dart_Handle* arguments);
@@ -1755,9 +1767,9 @@
/**
* Invokes a method or function.
*
- * The 'target' parameter may be an object, class, or library. If
+ * The 'target' parameter may be an object, type, or library. If
* 'target' is an object, then this function will invoke an instance
- * method. If 'target' is a class, then this function will invoke a
+ * method. If 'target' is a type, then this function will invoke a
* static method. If 'target' is a library, then this function will
* invoke a top-level function from that library.
*
@@ -1765,7 +1777,7 @@
*
* May generate an unhandled exception error.
*
- * \param target An object, class, or library.
+ * \param target An object, type, or library.
* \param name The name of the function or method to invoke.
* \param number_of_arguments Size of the arguments array.
* \param arguments An array of arguments to the function.
@@ -1796,9 +1808,9 @@
/**
* Gets the value of a field.
*
- * The 'container' parameter may be an object, class, or library. If
+ * The 'container' parameter may be an object, type, or library. If
* 'container' is an object, then this function will access an
- * instance field. If 'container' is a class, then this function will
+ * instance field. If 'container' is a type, then this function will
vsm 2013/06/18 22:45:51 This seems ambiguous now as a type is also an obje
siva 2013/06/18 23:09:54 Yes if it is a type then it would be a static call
vsm 2013/06/18 23:18:17 Ultimately, I think the API itself is ambiguous as
siva 2013/06/18 23:42:34 I think I will add a comment in the API that acces
* access a static field. If 'container' is a library, then this
* function will access a top-level variable.
*
@@ -1806,7 +1818,7 @@
*
* May generate an unhandled exception error.
*
- * \param container An object, class, or library.
+ * \param container An object, type, or library.
* \param name A field name.
*
* \return If no error occurs, then the value of the field is
@@ -1818,9 +1830,9 @@
/**
* Sets the value of a field.
*
- * The 'container' parameter may actually be an object, class, or
+ * The 'container' parameter may actually be an object, type, or
* library. If 'container' is an object, then this function will
- * access an instance field. If 'container' is a class, then this
+ * access an instance field. If 'container' is a type, then this
* function will access a static field. If 'container' is a library,
* then this function will access a top-level variable.
*
@@ -1828,7 +1840,7 @@
*
* May generate an unhandled exception error.
*
- * \param container An object, class, or library.
+ * \param container An object, type, or library.
* \param name A field name.
* \param value The new field value.
*
@@ -2086,8 +2098,8 @@
*/
DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library,
Dart_Handle class_name);
-/* TODO(turnidge): Consider returning Dart_Null() when the class is
- * not found to distinguish that from a true error case. */
+/* TODO(asiva): The above method needs to be removed once all uses
+ * of it are removed from the embedder code. */
/**
* Returns the url from which a library was loaded.
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698