| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /*readParameterInClosure:*/ |
| 6 readParameterInClosure(/**/ parameter) { |
| 7 /*captured=[parameter],free=[parameter]*/ func() => parameter; |
| 8 return func; |
| 9 } |
| 10 |
| 11 /*writeParameterInClosure:boxed=[parameter],captured=[parameter],requiresBox*/ |
| 12 writeParameterInClosure(/*boxed*/ parameter) { |
| 13 /*boxed=[parameter],captured=[parameter],free=[box,parameter]*/ func() { |
| 14 parameter = 42; |
| 15 } |
| 16 |
| 17 return func; |
| 18 } |
| 19 |
| 20 /*readLocalInClosure:*/ |
| 21 readLocalInClosure(/**/ parameter) { |
| 22 var /**/ local = parameter; |
| 23 /*captured=[local],free=[local]*/ func() => local; |
| 24 return func; |
| 25 } |
| 26 |
| 27 /*writeLocalInClosure:boxed=[local],captured=[local],requiresBox*/ |
| 28 writeLocalInClosure(/**/ parameter) { |
| 29 // ignore: UNUSED_LOCAL_VARIABLE |
| 30 var /*boxed*/ local = parameter; |
| 31 /*boxed=[local],captured=[local],free=[box,local]*/ func() { |
| 32 local = 42; |
| 33 } |
| 34 |
| 35 return func; |
| 36 } |
| 37 |
| 38 main() { |
| 39 readParameterInClosure(null); |
| 40 writeParameterInClosure(null); |
| 41 readLocalInClosure(null); |
| 42 writeLocalInClosure(null); |
| 43 } |
| OLD | NEW |