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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart

Issue 14066019: Change memberName and namedArguments in Invocation to use Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 56baf456c9eab94dec6a54493c687e0a34f0cd27..38adaf198ea63fc8bf506de415f8218c55343424 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -13,6 +13,16 @@ import 'dart:_js_helper' show checkNull,
stringJoinUnchecked;
import "dart:_collection-dev" as _symbol_dev;
+String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
+
+_symbolMapToStringMap(Map<Symbol, dynamic> map) {
+ var result = new Map<String, dynamic>();
+ map.forEach((Symbol key, value) {
+ result[_symbolToString(key)] = value;
+ });
+ return result;
+}
+
patch void print(var object) {
Primitives.printString(object.toString());
}
@@ -24,10 +34,11 @@ patch class Object {
patch String toString() => Primitives.objectToString(this);
patch dynamic noSuchMethod(Invocation invocation) {
- throw new NoSuchMethodError(this,
- invocation.memberName,
- invocation.positionalArguments,
- invocation.namedArguments);
+ throw new NoSuchMethodError(
+ this,
+ _symbolToString(invocation.memberName),
+ invocation.positionalArguments,
+ _symbolMapToStringMap(invocation.namedArguments));
}
patch Type get runtimeType {
@@ -50,7 +61,7 @@ patch class Function {
if (namedArguments == null) return null;
Map<String, dynamic> result = {};
namedArguments.forEach((symbol, value) {
- result[_symbol_dev.Symbol.getName(symbol)] = value;
+ result[_symbolToString(symbol)] = value;
});
return result;
}

Powered by Google App Engine
This is Rietveld 408576698