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

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

Issue 13942008: - Add synchronous mirror API. Resurrects invoke, apply, newInstance, (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 21575)
+++ sdk/lib/mirrors/mirrors.dart (working copy)
@@ -175,8 +175,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(Symbol memberName,
+ List positionalArguments,
+ [Map<Symbol,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(Symbol 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(Symbol 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].
*/
@@ -262,6 +292,13 @@
/**
* Executes the closure.
+ * The arguments are objects local to the current isolate.
+ */
+ InstanceMirror apply(List<Object> positionalArguments,
+ [Map<Symbol,Object> namedArguments]);
+
+ /**
+ * Executes the closure.
* The arguments must be instances of [InstanceMirror], [num],
* [String], or [bool].
*/
@@ -437,8 +474,17 @@
/**
* Invokes the named constructor and returns a mirror on the result.
+ * The arguments are objects local to the current isolate
+ */
+ /* TODO(turnidge): Properly document.*/
+ InstanceMirror newInstance(Symbol constructorName,
+ List positionalArguments,
+ [Map<Symbol,dynamic> namedArguments]);
+
+ /**
+ * Invokes the named constructor and returns a mirror on the result.
* The arguments must be instances of [InstanceMirror], [num],
- * [String], or [bool].
+ * [String] or [bool].
*/
/* TODO(turnidge): Properly document.*/
Future<InstanceMirror> newInstanceAsync(Symbol constructorName,
« 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