| 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 static var a; | 6 static var a; |
| 7 static var b = c; | 7 static var b = c; |
| 8 static final var c = 499; | 8 static const var c = 499; |
| 9 static final var d = c; | 9 static const var d = c; |
| 10 static final var e = d; | 10 static const var e = d; |
| 11 static final var f = B.g; | 11 static const var f = B.g; |
| 12 static final var h = true; | 12 static const var h = true; |
| 13 static final var i = false; | 13 static const var i = false; |
| 14 static final var j = n; | 14 static const var j = n; |
| 15 static final var k = 4.99; | 15 static const var k = 4.99; |
| 16 static final var l; | 16 static const var l; |
| 17 static final var m = l; | 17 static const var m = l; |
| 18 static final var n = 42; | 18 static const var n = 42; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class B { | 21 class B { |
| 22 static final var g = A.c; | 22 static const var g = A.c; |
| 23 } | 23 } |
| 24 | 24 |
| 25 testInitialValues() { | 25 testInitialValues() { |
| 26 Expect.equals(null, A.a); | 26 Expect.equals(null, A.a); |
| 27 Expect.equals(499, A.b); | 27 Expect.equals(499, A.b); |
| 28 Expect.equals(499, A.c); | 28 Expect.equals(499, A.c); |
| 29 Expect.equals(499, A.d); | 29 Expect.equals(499, A.d); |
| 30 Expect.equals(499, A.e); | 30 Expect.equals(499, A.e); |
| 31 Expect.equals(499, A.f); | 31 Expect.equals(499, A.f); |
| 32 Expect.equals(499, B.g); | 32 Expect.equals(499, B.g); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 45 A.b = 42; | 45 A.b = 42; |
| 46 Expect.equals(42, A.b); | 46 Expect.equals(42, A.b); |
| 47 Expect.equals(499, A.c); | 47 Expect.equals(499, A.c); |
| 48 Expect.equals(499, A.a); | 48 Expect.equals(499, A.a); |
| 49 } | 49 } |
| 50 | 50 |
| 51 main() { | 51 main() { |
| 52 testInitialValues(); | 52 testInitialValues(); |
| 53 testMutation(); | 53 testMutation(); |
| 54 } | 54 } |
| OLD | NEW |