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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.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/_internal/compiler/implementation/lib/core_patch.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index 6569d60ea5489c18b0ad41332af11e55d5f355b6..ba251b05ad3d5b024ebe1333fc81589222ac8acc 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -39,9 +39,19 @@ patch class Object {
patch class Function {
patch static apply(Function function,
List positionalArguments,
- [Map<String,dynamic> namedArguments]) {
+ [Map<Symbol, dynamic> namedArguments]) {
return Primitives.applyFunction(
- function, positionalArguments, namedArguments);
+ function, positionalArguments, _toMangledNames(namedArguments));
+ }
+
+ static Map<String, dynamic> _toMangledNames(
+ Map<Symbol, dynamic> namedArguments) {
+ if (namedArguments == null) return null;
+ Map<String, dynamic> result = {};
+ namedArguments.forEach((symbol, value) {
+ result[symbol._name] = value;
+ });
+ return result;
}
}
« no previous file with comments | « dart/runtime/lib/function_patch.dart ('k') | dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698