| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test static members. | 5 // Test static members. |
| 6 | 6 |
| 7 library lib; |
| 8 |
| 9 @MirrorsUsed(targets: "lib") |
| 7 import 'dart:mirrors'; | 10 import 'dart:mirrors'; |
| 8 | 11 |
| 9 import 'stringify.dart'; | 12 import 'stringify.dart'; |
| 10 | 13 |
| 11 class Foo { | 14 class Foo { |
| 12 static String bar = '...'; | 15 static String bar = '...'; |
| 13 String aux = ''; | 16 String aux = ''; |
| 14 static foo() {} | 17 static foo() {} |
| 15 baz() {} | 18 baz() {} |
| 16 } | 19 } |
| 17 | 20 |
| 18 void main() { | 21 void main() { |
| 19 expect('Variable(s(aux) in s(Foo))', | 22 expect('Variable(s(aux) in s(Foo))', |
| 20 reflectClass(Foo).declarations[new Symbol('aux')]); | 23 reflectClass(Foo).declarations[new Symbol('aux')]); |
| 21 expect('Method(s(baz) in s(Foo))', | 24 expect('Method(s(baz) in s(Foo))', |
| 22 reflectClass(Foo).declarations[new Symbol('baz')]); | 25 reflectClass(Foo).declarations[new Symbol('baz')]); |
| 23 expect('<null>', | 26 expect('<null>', |
| 24 reflectClass(Foo).declarations[new Symbol('aux=')]); | 27 reflectClass(Foo).declarations[new Symbol('aux=')]); |
| 25 expect('Method(s(foo) in s(Foo), static)', | 28 expect('Method(s(foo) in s(Foo), static)', |
| 26 reflectClass(Foo).declarations[new Symbol('foo')]); | 29 reflectClass(Foo).declarations[new Symbol('foo')]); |
| 27 expect('Variable(s(bar) in s(Foo), static)', | 30 expect('Variable(s(bar) in s(Foo), static)', |
| 28 reflectClass(Foo).declarations[new Symbol('bar')]); | 31 reflectClass(Foo).declarations[new Symbol('bar')]); |
| 29 } | 32 } |
| OLD | NEW |