| 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 /*readParameterInAnonymousClosure:*/ |
| 6 readParameterInAnonymousClosure(/**/ parameter) { |
| 7 return /*captured=[parameter],free=[parameter]*/ () => parameter; |
| 8 } |
| 9 |
| 5 /*readParameterInClosure:*/ | 10 /*readParameterInClosure:*/ |
| 6 readParameterInClosure(/**/ parameter) { | 11 readParameterInClosure(/**/ parameter) { |
| 7 /*captured=[parameter],free=[parameter]*/ func() => parameter; | 12 /*captured=[parameter],free=[parameter]*/ func() => parameter; |
| 8 return func; | 13 return func; |
| 9 } | 14 } |
| 10 | 15 |
| 16 /*writeParameterInAnonymousClosure:boxed=[parameter],captured=[parameter],requir
esBox*/ |
| 17 writeParameterInAnonymousClosure(/*boxed*/ parameter) { |
| 18 return /*boxed=[parameter],captured=[parameter],free=[box,parameter]*/ () { |
| 19 parameter = 42; |
| 20 }; |
| 21 } |
| 22 |
| 11 /*writeParameterInClosure:boxed=[parameter],captured=[parameter],requiresBox*/ | 23 /*writeParameterInClosure:boxed=[parameter],captured=[parameter],requiresBox*/ |
| 12 writeParameterInClosure(/*boxed*/ parameter) { | 24 writeParameterInClosure(/*boxed*/ parameter) { |
| 13 /*boxed=[parameter],captured=[parameter],free=[box,parameter]*/ func() { | 25 /*boxed=[parameter],captured=[parameter],free=[box,parameter]*/ func() { |
| 14 parameter = 42; | 26 parameter = 42; |
| 15 } | 27 } |
| 16 | 28 |
| 17 return func; | 29 return func; |
| 18 } | 30 } |
| 19 | 31 |
| 32 /*readLocalInAnonymousClosure:*/ |
| 33 readLocalInAnonymousClosure(/**/ parameter) { |
| 34 var /**/ local = parameter; |
| 35 return /*captured=[local],free=[local]*/ () => local; |
| 36 } |
| 37 |
| 20 /*readLocalInClosure:*/ | 38 /*readLocalInClosure:*/ |
| 21 readLocalInClosure(/**/ parameter) { | 39 readLocalInClosure(/**/ parameter) { |
| 22 var /**/ local = parameter; | 40 var /**/ local = parameter; |
| 23 /*captured=[local],free=[local]*/ func() => local; | 41 /*captured=[local],free=[local]*/ func() => local; |
| 24 return func; | 42 return func; |
| 25 } | 43 } |
| 26 | 44 |
| 45 /*writeLocalInAnonymousClosure:boxed=[local],captured=[local],requiresBox*/ |
| 46 writeLocalInAnonymousClosure(/**/ parameter) { |
| 47 // ignore: UNUSED_LOCAL_VARIABLE |
| 48 var /*boxed*/ local = parameter; |
| 49 return /*boxed=[local],captured=[local],free=[box,local]*/ () { |
| 50 local = 42; |
| 51 }; |
| 52 } |
| 53 |
| 27 /*writeLocalInClosure:boxed=[local],captured=[local],requiresBox*/ | 54 /*writeLocalInClosure:boxed=[local],captured=[local],requiresBox*/ |
| 28 writeLocalInClosure(/**/ parameter) { | 55 writeLocalInClosure(/**/ parameter) { |
| 29 // ignore: UNUSED_LOCAL_VARIABLE | 56 // ignore: UNUSED_LOCAL_VARIABLE |
| 30 var /*boxed*/ local = parameter; | 57 var /*boxed*/ local = parameter; |
| 31 /*boxed=[local],captured=[local],free=[box,local]*/ func() { | 58 /*boxed=[local],captured=[local],free=[box,local]*/ func() { |
| 32 local = 42; | 59 local = 42; |
| 33 } | 60 } |
| 34 | 61 |
| 35 return func; | 62 return func; |
| 36 } | 63 } |
| 37 | 64 |
| 38 main() { | 65 main() { |
| 66 readParameterInAnonymousClosure(null); |
| 39 readParameterInClosure(null); | 67 readParameterInClosure(null); |
| 68 writeParameterInAnonymousClosure(null); |
| 40 writeParameterInClosure(null); | 69 writeParameterInClosure(null); |
| 70 readLocalInAnonymousClosure(null); |
| 41 readLocalInClosure(null); | 71 readLocalInClosure(null); |
| 72 writeLocalInAnonymousClosure(null); |
| 42 writeLocalInClosure(null); | 73 writeLocalInClosure(null); |
| 43 } | 74 } |
| OLD | NEW |