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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 53883002: Ensure constructorName symbols include private manglings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | runtime/lib/mirrors_patch.dart » ('j') | tests/lib/mirrors/constructor_private_name_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 85bbae8387d0bdcee6a7ab820692fef7ebdcf681..754a7a7316dad6444e1c42536ca26c50f0de44a8 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -586,6 +586,10 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
return _superinterfaces;
}
+ _unmangleQualified(Symbol s) {
+ return _n(s).split('.').map((n) => MirrorSystem.getName(_s(n))).join('.');
+ }
+
get _mixinApplicationName {
var mixins = new List<ClassMirror>();
var klass = this;
@@ -593,10 +597,12 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
mixins.add(klass.mixin);
klass = klass.superclass;
}
+ // Strip out the private manglings early, but the VM's unmangling routine
+ // can't cope with them.
return _s(
- _n(klass.qualifiedName)
+ _unmangleQualified(klass.qualifiedName)
+ ' with '
- + mixins.reversed.map((m)=>_n(m.qualifiedName)).join(', '));
+ + mixins.reversed.map((m)=>_unmangleQualified(m.qualifiedName)).join(', '));
}
var _mixin;
@@ -1336,7 +1342,8 @@ class _LocalMethodMirrorImpl extends _LocalDeclarationMirrorImpl
'Internal error in MethodMirror.constructorName: '
'malformed name <$simpleName>');
} else if (parts.length == 2) {
- _constructorName = _s(parts[1]);
+ LibraryMirror definingLibrary = owner.owner;
+ _constructorName = MirrorSystem.getSymbol(parts[1], definingLibrary);
} else {
_constructorName = _s('');
}
« no previous file with comments | « no previous file | runtime/lib/mirrors_patch.dart » ('j') | tests/lib/mirrors/constructor_private_name_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698