| OLD | NEW |
| 1 // Copyright (c) 2013, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dartino 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"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 class A { | 7 class A { |
| 8 var _x; | 8 var _x; |
| 9 A(x) : _x = x { | 9 A(x) : _x = x { |
| 10 Expect.equals(x, _x); | 10 Expect.equals(x, _x); |
| 11 } | 11 } |
| 12 } | 12 } |
| 13 | 13 |
| 14 class B extends A { | 14 class B extends A { |
| 15 var _a; | 15 var _a; |
| 16 var _b; | 16 var _b; |
| 17 B(a): super(a), _a = a++ { | 17 B(a): super(a), _a = a++ { |
| 18 Expect.equals(a, _a + 1); | 18 Expect.equals(a, _a + 1); |
| 19 } | 19 } |
| 20 } | 20 } |
| 21 | 21 |
| 22 main() { | 22 main() { |
| 23 var o = new B(3); | 23 var o = new B(3); |
| 24 Expect.equals(3, o._a); | 24 Expect.equals(3, o._a); |
| 25 Expect.equals(null, o._b); | 25 Expect.equals(null, o._b); |
| 26 Expect.equals(3, o._x); | 26 Expect.equals(3, o._x); |
| 27 o = new A(3); | 27 o = new A(3); |
| 28 Expect.equals(3, o._x); | 28 Expect.equals(3, o._x); |
| 29 } | 29 } |
| 30 | 30 |
| OLD | NEW |