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

Side by Side Diff: pkg/kernel/testcases/interpreter/object_field_initializers_test.dart

Issue 3002013002: Fix initialization of instance fields. (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « pkg/kernel/lib/interpreter/interpreter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 library object_field_initializers_test; 5 library object_field_initializers_test;
6 6
7 /// Simple program creating an object with instance field initializers in the 7 /// Simple program creating an object with instance field initializers in the
8 /// declaration of the class. 8 /// declaration of the class.
9 /// 9 ///
10 /// The static function `fieldInitializer` is used to ensure the fields are 10 /// The static function `fieldInitializer` is used to ensure the fields are
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 String foo4 = fieldInitializer(5, 'foo4'); 53 String foo4 = fieldInitializer(5, 'foo4');
54 54
55 B(String foo1, String foo2) { 55 B(String foo1, String foo2) {
56 this.foo1 = foo1; 56 this.foo1 = foo1;
57 this.foo2 = foo2; 57 this.foo2 = foo2;
58 this.foo4 = fieldInitializer(6, 'bar4'); 58 this.foo4 = fieldInitializer(6, 'bar4');
59 } 59 }
60 } 60 }
61 61
62 class C { 62 class C {
63 static String staticFoo = 'foo';
Dmitry Stefantsov 2017/08/21 09:40:33 Looks like this update didn't change anything in t
63 String foo1 = fieldInitializer(1, 'foo1'); 64 String foo1 = fieldInitializer(1, 'foo1');
64 String foo2; 65 String foo2;
65 String foo3 = fieldInitializer(2, 'foo3'); 66 String foo3 = fieldInitializer(2, 'foo3');
66 67
67 C(this.foo1, this.foo2) { 68 C(this.foo1, this.foo2) {
68 foo3 = fieldInitializer(3, 'foo3'); 69 foo3 = fieldInitializer(3, 'foo3');
69 } 70 }
70 } 71 }
71 72
72 String fieldInitializer(int f, String s) { 73 String fieldInitializer(int f, String s) {
73 print('$s: $f'); 74 print('$s: $f');
74 return '$s: $f'; 75 return '$s: $f';
75 } 76 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/interpreter/interpreter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698