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

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: maintain dart2js coverage Created 7 years, 2 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
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
}
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698