| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, 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 // Testing InvocationMirror.invokeOn method; test of issue 7227. |
| 6 |
| 7 var reachedSetX = 0; |
| 8 var reachedGetX = 0; |
| 9 var reachedM = 0; |
| 10 |
| 11 class A { |
| 12 |
| 13 set x(val) { |
| 14 reachedSetX = val; |
| 15 } |
| 16 |
| 17 get x { |
| 18 reachedGetX = 1; |
| 19 } |
| 20 |
| 21 m() { reachedM = 1; } |
| 22 } |
| 23 |
| 24 class B { |
| 25 final a = new A(); |
| 26 noSuchMethod(mirror) => mirror.invokeOn(a); |
| 27 } |
| 28 |
| 29 main () { |
| 30 var b = new B(); |
| 31 b.x = 10; |
| 32 Expect.equals(10, reachedSetX); |
| 33 b.x; |
| 34 Expect.equals(1, reachedGetX); |
| 35 b.m(); |
| 36 Expect.equals(1, reachedM); |
| 37 } |
| OLD | NEW |