| OLD | NEW |
| 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 foo(res) { | 14 static foo(res) { |
| 15 return res; | 15 return res; |
| 16 } | 16 } |
| 17 | |
| 18 bar(res) { | |
| 19 return foo(res); | |
| 20 } | |
| 21 | |
| 22 bar2(res) { | |
| 23 return A.foo(res); | |
| 24 } | |
| 25 } | 17 } |
| 26 | 18 |
| 27 main() { | 19 main() { |
| 28 A a = new A(); | 20 expectEquals(42, A.foo(42)); |
| 29 expectEquals(42, a.bar(42)); | |
| 30 expectEquals(43, a.bar2(43)); | |
| 31 } | 21 } |
| OLD | NEW |