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

Side by Side Diff: frog/tests/leg_only/src/StaticField2Test.dart

Issue 8949039: Make sure a class is resolved before looking up its elements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 void expectEquals(var expected, var actual) { 5 void expectEquals(var expected, var actual) {
6 if (expected == actual) { 6 if (expected == actual) {
7 } else { 7 } else {
8 print("Actual does not match expected"); 8 print("Actual does not match expected");
9 throw actual; 9 throw actual;
10 } 10 }
11 } 11 }
12 12
13 class A { 13 class A {
14 static int b; 14 static int b;
15
16 setA(val) {
17 b = val;
18 }
19
20 bar() {
21 return b;
22 }
23
24 bar2() {
25 return A.b;
26 }
27 } 15 }
28 16
29 main() { 17 main() {
30 A a = new A(); 18 A.b = 42;
31 a.setA(42); 19 expectEquals(42, A.b);
32 expectEquals(42, a.bar());
33 expectEquals(42, a.bar2());
34 } 20 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698