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

Unified Diff: dart/sdk/lib/core/function.dart

Issue 14107006: Update Function.apply to use Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments 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
Index: dart/sdk/lib/core/function.dart
diff --git a/dart/sdk/lib/core/function.dart b/dart/sdk/lib/core/function.dart
index 4653294edd86271fa952e536880a0ef23430f85e..2ef7f741c02711230c6e8ebd2fa85cfdc9c2e1bc 100644
--- a/dart/sdk/lib/core/function.dart
+++ b/dart/sdk/lib/core/function.dart
@@ -21,13 +21,17 @@ abstract class Function {
* 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) :].
+ * Example: [:
+ * Map<Symbol, dynamic> namedArguments = new Map<Symbol, dynamic>();
+ * namedArguments[const Symbol("f")] = 4;
+ * namedArguments[const Symbol("g")] = 5;
+ * Function.apply(foo, [1,2,3], namedArguments); :]
+ * 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]);
+ [Map<Symbol, dynamic> namedArguments]);
}
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart ('k') | dart/tests/corelib/apply2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698