Index: runtime/lib/mirrors_patch.dart |
diff --git a/runtime/lib/mirrors_patch.dart b/runtime/lib/mirrors_patch.dart |
index 5b7539b637258d038227a96db76732d8dd2f2a86..2dbb6637d633c6799a702950902284c6863ce27d 100644 |
--- a/runtime/lib/mirrors_patch.dart |
+++ b/runtime/lib/mirrors_patch.dart |
@@ -43,6 +43,19 @@ patch ClassMirror reflectClass(Type key) { |
patch class MirrorSystem { |
/* patch */ static String getName(Symbol symbol) { |
- return _symbol_dev.Symbol.getName(symbol); |
+ return _unmangleName(_symbol_dev.Symbol.getName(symbol)); |
} |
+ /* patch */ static Symbol getSymbol(String name, [LibraryMirror library]) { |
+ if (library is! LibraryMirror || |
+ ((name[0] == '_') && (library == null))) { |
+ throw new ArgumentError(library); |
+ } |
+ if (library != null) name = _mangleName(name, library._reflectee); |
+ return new _symbol_dev.Symbol.unvalidated(name); |
+ } |
+ |
+ static _unmangleName(String name) |
+ native "Mirrors_unmangleName"; |
+ static _mangleName(String name, _MirrorReference lib) |
+ native "Mirrors_mangleName"; |
} |