OLD | NEW |
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 // Test that fast method extraction returns correct closure. | 4 // Test that fast method extraction returns correct closure. |
5 | 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
6 class A { | 8 class A { |
7 var f; | 9 var f; |
8 A(this.f); | 10 A(this.f); |
9 foo() => 40 + f; | 11 foo() => 40 + f; |
10 } | 12 } |
11 | 13 |
12 class B { | 14 class B { |
13 var f; | 15 var f; |
14 B(this.f); | 16 B(this.f); |
15 foo() => -40 - f; | 17 foo() => -40 - f; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 var chaB = new ChaB("magicB"); | 97 var chaB = new ChaB("magicB"); |
96 for (var i = 0; i < 10000; i++) { | 98 for (var i = 0; i < 10000; i++) { |
97 Expect.equals("B", cha(chaB)); | 99 Expect.equals("B", cha(chaB)); |
98 } | 100 } |
99 | 101 |
100 for (var i = 0; i < 10000; i++) { | 102 for (var i = 0; i < 10000; i++) { |
101 extractFromNull(); | 103 extractFromNull(); |
102 } | 104 } |
103 } | 105 } |
104 | 106 |
OLD | NEW |