| 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 import "package:expect/expect.dart"; |
| 6 |
| 5 class A { | 7 class A { |
| 6 var f; | 8 var f; |
| 7 var g; | 9 var g; |
| 8 A(a) : f = (() => 42 + a), g = (() => ++a) { | 10 A(a) : f = (() => 42 + a), g = (() => ++a) { |
| 9 a = 4; | 11 a = 4; |
| 10 } | 12 } |
| 11 } | 13 } |
| 12 | 14 |
| 13 class B extends A { | 15 class B extends A { |
| 14 B() : super(42); | 16 B() : super(42); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 33 a = new C(0); | 35 a = new C(0); |
| 34 Expect.equals(46, a.f()); | 36 Expect.equals(46, a.f()); |
| 35 Expect.equals(5, a.g()); | 37 Expect.equals(5, a.g()); |
| 36 Expect.equals(47, a.f()); | 38 Expect.equals(47, a.f()); |
| 37 Expect.equals(1, a.h()); | 39 Expect.equals(1, a.h()); |
| 38 Expect.equals(2, a.h()); | 40 Expect.equals(2, a.h()); |
| 39 Expect.equals(47, a.f()); | 41 Expect.equals(47, a.f()); |
| 40 Expect.equals(6, a.g()); | 42 Expect.equals(6, a.g()); |
| 41 Expect.equals(48, a.f()); | 43 Expect.equals(48, a.f()); |
| 42 } | 44 } |
| OLD | NEW |