OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 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 | 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 /*test:boxed=[b1,b2,b3],requiresBox*/ test(c1, /*boxed*/ b1) { | 5 /*test:box=box0,boxed=[b1,b2,b3]*/ test(c1, /*boxed*/ b1) { |
6 var /*boxed*/ b2 = 2; | 6 var /*boxed*/ b2 = 2; |
7 var /*boxed*/ b3 = 3; | 7 var /*boxed*/ b3 = 3; |
8 var c2 = 2; | 8 var c2 = 2; |
9 var c3 = 3; | 9 var c3 = 3; |
10 /*boxed=[b1,b2,b3,b4],captured=[b1,b2,b3,b4,c1,c2,c3],free=[b1,b2,b3,box,c1,c2
,c3]*/ () { | 10 /*box=box1,boxed=[b4],free=[b1,b2,b3,box0,c1,c2,c3]*/ () { |
11 var c4 = c1 + c2 + c3; | 11 var c4 = c1 + c2 + c3; |
12 var b4 = (b1 = 1) + (b2 = 2) + (b3 = 3); | 12 var /*boxed*/ b4 = (b1 = 1) + (b2 = 2) + (b3 = 3); |
13 | 13 |
14 /*boxed=[b1,b2,b4],captured=[b1,b2,b4,c4],free=[b1,b2,b4,box,box,c4]*/ () { | 14 /*free=[b1,b2,b4,box0,box1,c4]*/ () { |
15 return c4 + (b1 = 1) + (b2 = 2) + (b4 = 4); | 15 return c4 + (b1 = 1) + (b2 = 2) + (b4 = 4); |
16 }; | 16 }; |
17 | 17 |
18 return b4; | 18 return b4; |
19 }; | 19 }; |
20 return b1 + b2 + b3 + c1 + c2 + c3; | 20 return b1 + b2 + b3 + c1 + c2 + c3; |
21 } | 21 } |
22 | 22 |
23 main() { | 23 main() { |
24 test(1, 2); | 24 test(1, 2); |
25 } | 25 } |
OLD | NEW |