| 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 // dart2js regression test for issue 8781. | 5 // dart2js regression test for issue 8781. |
| 6 | 6 |
| 7 import "dart:mirrors" show reflect; |
| 7 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 8 | 9 |
| 9 class N { | 10 class N { |
| 10 var outgoing; | 11 var outgoing; |
| 11 var incoming; | 12 var incoming; |
| 12 N(this.outgoing, this.incoming); | 13 N(this.outgoing, this.incoming); |
| 13 } | 14 } |
| 14 | 15 |
| 15 class A { | 16 class A { |
| 16 int offset = 0; | 17 int offset = 0; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 31 } else | 32 } else |
| 32 list = null; | 33 list = null; |
| 33 return edge; | 34 return edge; |
| 34 } | 35 } |
| 35 } | 36 } |
| 36 | 37 |
| 37 class L { | 38 class L { |
| 38 final list; | 39 final list; |
| 39 L(this.list); | 40 L(this.list); |
| 40 // Use noSuchMethod to defeat type inferencing. | 41 // Use noSuchMethod to defeat type inferencing. |
| 41 noSuchMethod(mirror) => mirror.invokeOn(list); | 42 noSuchMethod(mirror) => reflect(list).delegate(mirror); |
| 42 } | 43 } |
| 43 | 44 |
| 44 main () { | 45 main () { |
| 45 var o = new A(new N(new L([1]), new L([2]))); | 46 var o = new A(new N(new L([1]), new L([2]))); |
| 46 | 47 |
| 47 for (var i = 1; i <= 2; i++) | 48 for (var i = 1; i <= 2; i++) |
| 48 Expect.equals(i, o.next()); | 49 Expect.equals(i, o.next()); |
| 49 | 50 |
| 50 Expect.equals(null, o.list); | 51 Expect.equals(null, o.list); |
| 51 } | 52 } |
| OLD | NEW |