Chromium Code Reviews| Index: lib/core/function.dart |
| diff --git a/lib/core/function.dart b/lib/core/function.dart |
| index 57b960a547ded8849cf644e176a247ff693960fe..7b027daed44a6755715b77d0021dd8873e4da210 100644 |
| --- a/lib/core/function.dart |
| +++ b/lib/core/function.dart |
| @@ -4,5 +4,30 @@ |
| // Dart core library. |
| +/** |
| + * Super-type of all function types. |
| + * |
| + * A function value, or an instance of a class with a "call" method, is a |
| + * subtype of a function type, and as such, a subtype of [Function]. |
| + */ |
| abstract class Function { |
| + /** |
| + * Dynamically call [function] with the specified arguments. |
| + * |
| + * Acts the same as calling function with positional arguments |
| + * corresponding to the elements of [positionalArguments] and |
| + * named arguments corresponding to the elements of [namedArguments]. |
| + * |
| + * This includes giving the same errors if [function] isn't callable or |
| + * if it expects different parameters. |
| + * |
| + * Example: [: Function.apply(foo, [1,2,3], {"f": 4, "g": 5}) :] gives |
| + * exactly the same result as [: foo(1, 2, 3, f: 4, g: 5) :]. |
| + * |
| + * if [positionalArguments] is null, it's considered an empty list. |
|
kasperl
2012/10/05 12:51:54
if -> If
Lasse Reichstein Nielsen
2012/10/05 12:52:59
Done.
|
| + * If [namedArguments] is omitted or null, it is considered an empty map. |
| + */ |
| + external static apply(Function function, |
| + List positionalArguments, |
| + [Map<String,Dynamic> namedArguments]); |
| } |