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

Unified Diff: lib/core/function.dart

Issue 11035069: Reapply r13292 WITH a fix to apply_test.dart that was failing on dartc (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « lib/compiler/implementation/lib/core_patch.dart ('k') | runtime/lib/function_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/function.dart
===================================================================
--- lib/core/function.dart (revision 13334)
+++ lib/core/function.dart (working copy)
@@ -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.
+ * If [namedArguments] is omitted or null, it is considered an empty map.
+ */
+ external static apply(Function function,
+ List positionalArguments,
+ [Map<String,Dynamic> namedArguments]);
}
« no previous file with comments | « lib/compiler/implementation/lib/core_patch.dart ('k') | runtime/lib/function_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698