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

Unified Diff: sdk/lib/mirrors/mirrors.dart

Issue 14044007: Add synchronous mirror API. Resurrects invoke, apply, newInstance, getField and setField as synchro… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/bootstrap_natives.h ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/mirrors/mirrors.dart
===================================================================
--- sdk/lib/mirrors/mirrors.dart (revision 21243)
+++ sdk/lib/mirrors/mirrors.dart (working copy)
@@ -172,8 +172,38 @@
* See [InstanceMirror], [ClassMirror], and [LibraryMirror].
*/
abstract class ObjectMirror implements Mirror {
+
/**
* Invokes the named function and returns a mirror on the result.
+ * The arguments are objects local to the current isolate.
+ */
+ /* TODO(turnidge): Properly document.
+ * TODO(turnidge): Handle ambiguous names.
+ * TODO(turnidge): Handle optional & named arguments.
+ */
+ InstanceMirror invoke(String memberName,
+ List positionalArguments,
+ [Map<String,dynamic> namedArguments]);
+
+ /**
+ * Invokes a getter and returns a mirror on the result. The getter
+ * can be the implicit getter for a field or a user-defined getter
+ * method.
+ */
+ /* TODO(turnidge): Handle ambiguous names.*/
+ InstanceMirror getField(String fieldName);
+
+ /**
+ * Invokes a setter and returns a mirror on the result. The setter
+ * may be either the implicit setter for a non-final field or a
+ * user-defined setter method.
+ * The argument is an object local to the current isolate.
+ */
+ /* TODO(turnidge): Handle ambiguous names.*/
+ InstanceMirror setField(String fieldName, Object arg);
+
+ /**
+ * Invokes the named function and returns a mirror on the result.
* The arguments must be instances of [InstanceMirror], [num],
* [String] or [bool].
*/
@@ -259,6 +289,13 @@
/**
* Executes the closure.
+ * The arguments are objects local to the current isolate.
+ */
+ InstanceMirror apply(List<Object> positionalArguments,
+ [Map<String,Object> namedArguments]);
+
+ /**
+ * Executes the closure.
* The arguments must be instances of [InstanceMirror], [num],
* [String] or [bool].
*/
@@ -433,9 +470,19 @@
/**
* Invokes the named constructor and returns a mirror on the result.
- * The arguments must be instances of [InstanceMirror], [num],
+ * The arguments are objects local to the current isolate
*/
/* TODO(turnidge): Properly document.*/
+ InstanceMirror newInstance(String constructorName,
+ List positionalArguments,
+ [Map<String,dynamic> namedArguments]);
+
+ /**
+ * Invokes the named constructor and returns a mirror on the result.
+ * The arguments must be instances of [InstanceMirror], [num],
+ * [String] or [bool].
+ */
+ /* TODO(turnidge): Properly document.*/
Future<InstanceMirror> newInstanceAsync(String constructorName,
List<Object> positionalArguments,
[Map<String,Object> namedArguments]);
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698