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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 19579006: Adding proper handling for MethodMirror.owner (Closed) Base URL: https://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
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
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 838af66094bca44edbd6b662882145e3475d349e..5cdc20723915775b03c2a0a3141e6fb67baeaf4b 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -898,6 +898,12 @@ class _LocalMethodMirrorImpl extends _LocalMirrorImpl
var _owner;
DeclarationMirror get owner {
+ // For nested closures it is possible, that the mirror for the owner has not
+ // been created yet.
+ if (_owner == null) {
+ _owner = _MethodMirror_owner(_reflectee);
+ }
+ // TODO(11897): This will go away, as soon as lazy mirrors go away.
if (_owner is! Mirror) {
_owner = _owner.resolve(mirrors);
}
@@ -977,6 +983,9 @@ class _LocalMethodMirrorImpl extends _LocalMirrorImpl
static String _MethodMirror_name(reflectee)
native "MethodMirror_name";
+
+ static dynamic _MethodMirror_owner(reflectee)
+ native "MethodMirror_owner";
}
class _LocalVariableMirrorImpl extends _LocalMirrorImpl
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698