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

Unified Diff: runtime/lib/mirrors.cc

Issue 26436004: Implement constructor kinds in the VM mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: both_ 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
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index be30b5deb8d1184d08c65f9bbff634554e7a01b2..59ac369d92bed1d63583f8d4595f2f0e1ede2652 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -261,12 +261,14 @@ static RawInstance* CreateMethodMirror(const Function& func,
args.SetAt(4, Bool::Get(func.is_abstract()));
args.SetAt(5, Bool::Get(func.IsGetterFunction()));
args.SetAt(6, Bool::Get(func.IsSetterFunction()));
- args.SetAt(7, Bool::Get(func.kind() == RawFunction::kConstructor));
- // TODO(mlippautz): Implement different constructor kinds.
- args.SetAt(8, Bool::False());
- args.SetAt(9, Bool::False());
- args.SetAt(10, Bool::False());
- args.SetAt(11, Bool::False());
+
+ bool isConstructor = (func.kind() == RawFunction::kConstructor);
+ args.SetAt(7, Bool::Get(isConstructor));
+ args.SetAt(8, Bool::Get(isConstructor && func.is_const()));
+ args.SetAt(9, Bool::Get(isConstructor && func.IsConstructor()));
+ args.SetAt(10, Bool::Get(isConstructor && func.is_redirecting()));
+ args.SetAt(11, Bool::Get(isConstructor && func.IsFactory()));
+
return CreateMirror(Symbols::_LocalMethodMirrorImpl(), args);
}
« no previous file with comments | « no previous file | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | tests/lib/mirrors/constructor_kinds_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698