| 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 import "package:expect/expect.dart"; |
| 6 |
| 5 class Proxy { | 7 class Proxy { |
| 6 final proxied; | 8 final proxied; |
| 7 Proxy(this.proxied); | 9 Proxy(this.proxied); |
| 8 noSuchMethod(mirror) => mirror.invokeOn(proxied); | 10 noSuchMethod(mirror) => mirror.invokeOn(proxied); |
| 9 } | 11 } |
| 10 | 12 |
| 11 main() { | 13 main() { |
| 12 testList(); | 14 testList(); |
| 13 testString(); | 15 testString(); |
| 14 testInt(); | 16 testInt(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 testDouble() { | 71 testDouble() { |
| 70 var number = 42.99; | 72 var number = 42.99; |
| 71 var proxy = new Proxy(number); | 73 var proxy = new Proxy(number); |
| 72 | 74 |
| 73 Expect.equals(number + 87, proxy + 87); | 75 Expect.equals(number + 87, proxy + 87); |
| 74 Expect.equals(number.toInt(), proxy.toInt()); | 76 Expect.equals(number.toInt(), proxy.toInt()); |
| 75 | 77 |
| 76 Expect.throws(() => proxy.funky(), (e) => e is NoSuchMethodError); | 78 Expect.throws(() => proxy.funky(), (e) => e is NoSuchMethodError); |
| 77 Expect.throws(() => number.funky(), (e) => e is NoSuchMethodError); | 79 Expect.throws(() => number.funky(), (e) => e is NoSuchMethodError); |
| 78 } | 80 } |
| OLD | NEW |