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 19188004: Make the ClassMirrors created through reflectClass() find their owners (libraries) lazily. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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_impl.dart
===================================================================
--- runtime/lib/mirrors_impl.dart (revision 25038)
+++ runtime/lib/mirrors_impl.dart (working copy)
@@ -440,7 +440,10 @@
var _owner;
DeclarationMirror get owner {
- if (_owner != null && _owner is! Mirror) {
+ if (_owner == null) {
+ _owner = _library(_reflectee);
+ }
+ if (_owner is! Mirror) {
_owner = _owner.resolve(mirrors);
}
return _owner;
@@ -590,6 +593,9 @@
static _name(reflectee)
native "ClassMirror_name";
+ static _library(reflectee)
+ native "ClassMirror_library";
+
_invoke(reflectee, memberName, positionalArguments)
native 'ClassMirror_invoke';

Powered by Google App Engine
This is Rietveld 408576698