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

Unified Diff: runtime/lib/mirrors_patch.dart

Issue 24631003: Add proper API for creating private symbols wrt a library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rename StripAccessorPrefix Created 7 years, 3 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: runtime/lib/mirrors_patch.dart
diff --git a/runtime/lib/mirrors_patch.dart b/runtime/lib/mirrors_patch.dart
index 5b7539b637258d038227a96db76732d8dd2f2a86..ee780fbdcac418a8bc634fa5936b32332858690b 100644
--- a/runtime/lib/mirrors_patch.dart
+++ b/runtime/lib/mirrors_patch.dart
@@ -43,6 +43,15 @@ 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 lib]) {
+ if (lib != null) name = _mangleName(name, lib._reflectee);
+ return new _symbol_dev.Symbol.unvalidated(name);
+ }
+
+ static _unmangleName(String name)
+ native "Mirrors_unmangleName";
+ static _mangleName(String name, _MirrorReference lib)
+ native "Mirrors_mangleName";
}

Powered by Google App Engine
This is Rietveld 408576698