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

Unified Diff: tests/lib/mirrors/constructors_test.dart

Issue 63563003: - Reverting mirror changes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « tests/lib/mirrors/constructor_kinds_test.dart ('k') | tests/lib/mirrors/equality_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/constructors_test.dart
===================================================================
--- tests/lib/mirrors/constructors_test.dart (revision 30026)
+++ tests/lib/mirrors/constructors_test.dart (working copy)
@@ -10,6 +10,14 @@
import 'stringify.dart';
+constructorsOf(ClassMirror cm) {
+ var result = new Map();
+ cm.declarations.forEach((k,v) {
+ if(v is MethodMirror && v.isConstructor) result[k] = v;
+ });
+ return result;
+}
+
class Foo {
}
@@ -28,13 +36,13 @@
main() {
ClassMirror fooMirror = reflectClass(Foo);
- Map<Symbol, MethodMirror> fooConstructors = fooMirror.constructors;
+ Map<Symbol, MethodMirror> fooConstructors = constructorsOf(fooMirror);
ClassMirror barMirror = reflectClass(Bar);
- Map<Symbol, MethodMirror> barConstructors = barMirror.constructors;
+ Map<Symbol, MethodMirror> barConstructors = constructorsOf(barMirror);
ClassMirror bazMirror = reflectClass(Baz);
- Map<Symbol, MethodMirror> bazConstructors = bazMirror.constructors;
+ Map<Symbol, MethodMirror> bazConstructors = constructorsOf(bazMirror);
ClassMirror bizMirror = reflectClass(Biz);
- Map<Symbol, MethodMirror> bizConstructors = bizMirror.constructors;
+ Map<Symbol, MethodMirror> bizConstructors = constructorsOf(bizMirror);
expect('{Foo: Method(s(Foo) in s(Foo), constructor)}', fooConstructors);
expect('{Bar: Method(s(Bar) in s(Bar), constructor)}', barConstructors);
« no previous file with comments | « tests/lib/mirrors/constructor_kinds_test.dart ('k') | tests/lib/mirrors/equality_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698