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

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

Issue 3002013002: Fix initialization of instance fields. (Closed)
Patch Set: Add test with instance and static fields. 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library object_field_initializers_test;
6
7 /// Simple program creating an object with instance field initializers and
8 /// static fields in the declaration of the class.
9 void main() {
10 print('Create instance of A');
11 var a1 = new A();
12 print(a1.foo1);
13 print(a1.foo2);
14 print(a1.foo3);
15
16 print('Read staticFoo');
17 print(A.staticFoo);
18 }
19
20 class A {
21 static String staticFoo = 'staticFoo';
22 String foo1 = 'foo1';
23 String foo2;
24 String foo3 = 'foo3';
25
26 A() {
27 this.foo2 = 'foo2';
28 }
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698