OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, 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 @metadata |
| 6 library regress_19731; |
| 7 |
| 8 import 'dart:mirrors'; |
| 9 import 'package:expect/expect.dart'; |
| 10 |
| 11 @metadata |
| 12 const metadata = const Object(); |
| 13 |
| 14 class OneField { |
| 15 @metadata |
| 16 var onlyClassField; |
| 17 |
| 18 @metadata |
| 19 method() {} |
| 20 } |
| 21 |
| 22 @metadata |
| 23 method() {} |
| 24 |
| 25 main() { |
| 26 var classFieldNames = reflectType(OneField).declarations.values |
| 27 .where((v) => v is VariableMirror).map((v) => v.simpleName).toList(); |
| 28 Expect.setEquals([#onlyClassField], classFieldNames); |
| 29 |
| 30 var libraryFieldNames = reflectType(OneField).owner.declarations.values |
| 31 .where((v) => v is VariableMirror).map((v) => v.simpleName).toList(); |
| 32 Expect.setEquals([#metadata], libraryFieldNames); |
| 33 } |
OLD | NEW |