| 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 // Test that field initializers are evaluated in the right order. | 5 // Test that field initializers are evaluated in the right order. |
| 5 | 6 |
| 6 int counter = 0; | 7 int counter = 0; |
| 7 | 8 |
| 8 class Mark { | 9 class Mark { |
| 9 static StringBuffer buffer; | 10 static StringBuffer buffer; |
| 10 Mark(value) { | 11 Mark(value) { |
| 11 buffer.add('$value.'); | 12 buffer.add('$value.'); |
| 12 } | 13 } |
| 13 } | 14 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 56 |
| 56 main() { | 57 main() { |
| 57 Expect.equals('a.', run(() => new OneField())); | 58 Expect.equals('a.', run(() => new OneField())); |
| 58 Expect.equals('a.ai.', run(() => new OneField.init())); | 59 Expect.equals('a.ai.', run(() => new OneField.init())); |
| 59 | 60 |
| 60 Expect.equals('b.a.', run(() => new TwoFields())); | 61 Expect.equals('b.a.', run(() => new TwoFields())); |
| 61 Expect.equals('b.a.ai.', run(() => new TwoFields.initA())); | 62 Expect.equals('b.a.ai.', run(() => new TwoFields.initA())); |
| 62 Expect.equals('b.a.bi.', run(() => new TwoFields.initB())); | 63 Expect.equals('b.a.bi.', run(() => new TwoFields.initB())); |
| 63 Expect.equals('b.a.ai.bi.', run(() => new TwoFields.initBoth())); | 64 Expect.equals('b.a.ai.bi.', run(() => new TwoFields.initBoth())); |
| 64 | 65 |
| 65 Expect.equals('b.a.', run(() => new InheritOneField())); | 66 Expect.equals('b.a.', run(() => |
| 66 Expect.equals('b.bi.a.', run(() => new InheritOneField.init())); | 67 new InheritOneField())); |
| 67 Expect.equals('b.a.ai.', run(() => new InheritOneField.superWithInit())); | 68 Expect.equals('b.bi.a.', run(() => |
| 68 Expect.equals('b.bi.a.ai.', run(() => new InheritOneField.initWithSuperInit())
); | 69 new InheritOneField.init())); |
| 69 Expect.equals('b.a.ai.bi.', run(() => new InheritOneField.initWithSuperInit2()
)); | 70 Expect.equals('b.a.ai.', run(() => |
| 71 new InheritOneField.superWithInit())); |
| 72 Expect.equals('b.bi.a.ai.', run(() => |
| 73 new InheritOneField.initWithSuperInit())); |
| 74 Expect.equals('b.a.ai.bi.', run(() => |
| 75 new InheritOneField.initWithSuperInit2())); |
| 70 } | 76 } |
| OLD | NEW |