Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tests/language/field_initialization_order_test.dart

Issue 12473003: Remove deprecated StringBuffer.add, addAll and addCharCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Test that field initializers are evaluated in the right order. 5 // Test that field initializers are evaluated in the right order.
6 6
7 int counter = 0; 7 int counter = 0;
8 8
9 class Mark { 9 class Mark {
10 static StringBuffer buffer; 10 static StringBuffer buffer;
11 Mark(value) { 11 Mark(value) {
12 buffer.add('$value.'); 12 buffer.write('$value.');
13 } 13 }
14 } 14 }
15 15
16 class OneField { 16 class OneField {
17 var a = new Mark('a'); 17 var a = new Mark('a');
18 18
19 OneField(); 19 OneField();
20 20
21 OneField.init() : a = new Mark('ai'); 21 OneField.init() : a = new Mark('ai');
22 } 22 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 new InheritOneField())); 67 new InheritOneField()));
68 Expect.equals('b.bi.a.', run(() => 68 Expect.equals('b.bi.a.', run(() =>
69 new InheritOneField.init())); 69 new InheritOneField.init()));
70 Expect.equals('b.a.ai.', run(() => 70 Expect.equals('b.a.ai.', run(() =>
71 new InheritOneField.superWithInit())); 71 new InheritOneField.superWithInit()));
72 Expect.equals('b.bi.a.ai.', run(() => 72 Expect.equals('b.bi.a.ai.', run(() =>
73 new InheritOneField.initWithSuperInit())); 73 new InheritOneField.initWithSuperInit()));
74 Expect.equals('b.a.ai.bi.', run(() => 74 Expect.equals('b.a.ai.bi.', run(() =>
75 new InheritOneField.initWithSuperInit2())); 75 new InheritOneField.initWithSuperInit2()));
76 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698