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