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

Unified Diff: include/dart_api.h

Issue 10153002: Add Dart_New. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 | vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/dart_api.h
===================================================================
--- include/dart_api.h (revision 6717)
+++ include/dart_api.h (working copy)
@@ -1698,9 +1698,31 @@
// DEPRECATED: The API below is a temporary hack.
DART_EXPORT void Dart_ClosureSetSmrck(Dart_Handle object, int64_t value);
-// --- Methods and Fields ---
+// --- Constructors, Methods, and Fields ---
/**
+ * Invokes a constructor, creating a new object.
+ *
+ * This function allows hidden constructors (constructors with leading
+ * underscores) to be called.
+ *
+ * \param clazz A class.
hausner 2012/04/19 23:15:41 Nit: A class or interface.
+ * \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.
+ * \param number_of_arguments Size of the arguments array.
+ * \param arguments An array of arguments to the constructor.
+ *
+ * \return If the constructor is called and completes successfully,
+ * 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_Handle constructor_name,
+ int number_of_arguments,
+ Dart_Handle* arguments);
+
+/**
* Invokes a method or function.
*
* The 'target' parameter may be an object, class, or library. If
« no previous file with comments | « no previous file | vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698