OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library test.instance_members; |
| 6 |
| 7 import 'dart:mirrors'; |
| 8 import 'package:expect/expect.dart'; |
| 9 |
| 10 import 'declarations_model.dart' as declarations_model; |
| 11 |
| 12 selectKeys(map, predicate) { |
| 13 return map.keys.where((key) => predicate(map[key])); |
| 14 } |
| 15 |
| 16 main() { |
| 17 ClassMirror cm = reflectClass(declarations_model.Class); |
| 18 |
| 19 Expect.setEquals( |
| 20 [#+, |
| 21 #abstractMethod, |
| 22 #instanceVariable, |
| 23 const Symbol('instanceVariable='), |
| 24 #instanceGetter, |
| 25 const Symbol('instanceSetter='), |
| 26 #instanceMethod, |
| 27 #-, |
| 28 #inheritedInstanceVariable, |
| 29 const Symbol('inheritedInstanceVariable='), |
| 30 #inheritedInstanceGetter, |
| 31 const Symbol('inheritedInstanceSetter='), |
| 32 #inheritedInstanceMethod, |
| 33 #*, |
| 34 #mixinInstanceVariable, |
| 35 const Symbol('mixinInstanceVariable='), |
| 36 #mixinInstanceGetter, |
| 37 const Symbol('mixinInstanceSetter='), |
| 38 #mixinInstanceMethod, |
| 39 #hashCode, |
| 40 #runtimeType, |
| 41 #==, |
| 42 #noSuchMethod, |
| 43 #toString], |
| 44 selectKeys(cm.instanceMembers, (dm) => !dm.isPrivate)); |
| 45 // Filter out private to avoid implementation-specific members of Object. |
| 46 |
| 47 Expect.setEquals( |
| 48 [#instanceVariable, |
| 49 const Symbol('instanceVariable='), |
| 50 #inheritedInstanceVariable, |
| 51 const Symbol('inheritedInstanceVariable='), |
| 52 #mixinInstanceVariable, |
| 53 const Symbol('mixinInstanceVariable=')], |
| 54 selectKeys(cm.instanceMembers, (dm) => dm.isSynthetic)); |
| 55 } |
OLD | NEW |