| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 class A { | 5 class A { |
| 6 foo() => 499; | 6 foo() => 499; |
| 7 bar([a = 1, b = 7, c = 99]) => a + b + c; | 7 bar([a = 1, b = 7, c = 99]) => a + b + c; |
| 8 toto() => bar; | 8 toto() => bar; |
| 9 gee(f) => f(toto); | 9 gee(f) => f(toto); |
| 10 } | 10 } |
| 11 | 11 |
| 12 main() { | 12 main() { |
| 13 var a = new A(); | 13 var a = new A(); |
| 14 var foo = a.foo; | 14 var foo = a.foo; |
| 15 Expect.equals(499, foo()); | 15 Expect.equals(499, foo()); |
| 16 var bar = a.bar; | 16 var bar = a.bar; |
| 17 Expect.equals(107, bar()); | 17 Expect.equals(107, bar()); |
| 18 Expect.equals(3, bar(1, 1, 1)); | 18 Expect.equals(3, bar(1, 1, 1)); |
| 19 Expect.equals(10, bar(c: 2)); | 19 Expect.equals(10, bar(c: 2)); |
| 20 var toto = a.toto; | 20 var toto = a.toto; |
| 21 var gee = a.gee; | 21 var gee = a.gee; |
| 22 Expect.equals(-10, gee((f) => f()(-1, -2, c: -7))); | 22 Expect.equals(-10, gee((f) => f()(-1, -2, c: -7))); |
| 23 } | 23 } |
| OLD | NEW |