Index: sdk/lib/mirrors/mirrors.dart |
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart |
index 1a84d70af30bd75d7d49c083328bf5e6cc616ead..2651d723a5295400155dd520b5e175e2a4493b9a 100644 |
--- a/sdk/lib/mirrors/mirrors.dart |
+++ b/sdk/lib/mirrors/mirrors.dart |
@@ -475,6 +475,30 @@ abstract class InstanceMirror implements ObjectMirror { |
* invocation.namedArguments); |
*/ |
delegate(Invocation invocation); |
+ |
+ /** |
+ * Returns a closure for invoking the regular method named [name]. |
+ * |
+ * If [:type.instanceLookup(name):] returns a regular method m, the result of |
+ * this method is a closure equivalent to: |
+ * |
+ * (r1, ..., rn, {p1: d1, ..., pk: dk}) { |
+ * return this.invoke(name, [r1, ..., rn], {#p1: p1, ..., #pk: pk}); |
+ * } |
+ * |
+ * if m has required parameters r1, ..., rn, and named parameters p1, ..., pk |
+ * with defaults d1, ..., dk. The result of this method is a |
+ * closure equivalent to: |
+ * |
+ * (r1, ..., rn, [p1 = d1, ..., pk = dk]) { |
+ * return this.invoke(name, [r1, ..., rn, p1, ..., pk]); |
+ * } |
+ * |
+ * if m has required parameters r1, ..., rn, and optional positional |
+ * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an |
+ * [ArgumentError] is thrown. |
+ */ |
+ Function operator [](Symbol name); |
} |
/** |
@@ -566,6 +590,28 @@ abstract class LibraryMirror implements DeclarationMirror, ObjectMirror { |
* the same library in the same isolate. |
*/ |
bool operator ==(other); |
+ |
+ /** |
+ * If [:declarations[name]:] is a regular method m, the result of this method |
+ * is a closure equivalent to: |
+ * |
+ * (r1, ..., rn, {p1: d1, ..., pk: dk}) { |
+ * return this.invoke(name, [r1, ..., rn], {#p1: p1, ..., #pk: pk}); |
+ * } |
+ * |
+ * if m has required parameters r1, ..., rn, and named parameters p1, ..., pk |
+ * with defaults d1, ..., dk. The result of this method is a |
+ * closure equivalent to: |
+ * |
+ * (r1, ..., rn, [p1 = d1, ..., pk = dk]) { |
+ * return this.invoke(name, [r1, ..., rn, p1, ..., pk]); |
+ * } |
+ * |
+ * if m has required parameters r1, ..., rn, and optional positional |
+ * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an |
+ * [ArgumentError] is thrown. |
+ */ |
+ Function operator [](Symbol name); |
} |
/** |
@@ -723,6 +769,28 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror { |
* and [other] have equal type arguments. |
*/ |
bool operator == (other); |
+ |
+ /** |
+ * If [:declarations[name]:] is a regular method m, the result of this method |
+ * is a closure equivalent to: |
+ * |
+ * (r1, ..., rn, {p1: d1, ..., pk: dk}) { |
+ * return this.invoke(name, [r1, ..., rn], {#p1: p1, ..., #pk: pk}); |
+ * } |
+ * |
+ * if m has required parameters r1, ..., rn, and named parameters p1, ..., pk |
+ * with defaults d1, ..., dk. The result of this method is a |
+ * closure equivalent to: |
+ * |
+ * (r1, ..., rn, [p1 = d1, ..., pk = dk]) { |
+ * return this.invoke(name, [r1, ..., rn, p1, ..., pk]); |
+ * } |
+ * |
+ * if m has required parameters r1, ..., rn, and optional positional |
+ * parameters p1, ..., pk with defaults d1, ..., dk. Otherwise, an |
+ * [ArgumentError] is thrown. |
+ */ |
+ Function operator [](Symbol name); |
} |
/** |