Chromium Code Reviews| 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 ; | |
|
Emily Fortuna
2017/08/16 00:55:11
why the weird whitespace with this semicolon?
Johnni Winther
2017/08/16 07:30:19
That's how dartfmt puts a ; after a function decla
| |
| 18 return func; | |
| 19 } | |
| 20 | |
| 21 /*readLocalInClosure:*/ | |
| 22 readLocalInClosure(/**/ parameter) { | |
| 23 var /**/ local = parameter; | |
| 24 /*captured=[local],free=[local]*/ func() => local; | |
| 25 return func; | |
| 26 } | |
| 27 | |
| 28 /*writeLocalInClosure:boxed=[local],captured=[local],requiresBox*/ | |
| 29 writeLocalInClosure(/**/ parameter) { | |
| 30 // ignore: UNUSED_LOCAL_VARIABLE | |
| 31 var /*boxed*/ local = parameter; | |
| 32 /*boxed=[local],captured=[local],free=[box,local]*/ func() { | |
| 33 local = 42; | |
| 34 } | |
| 35 | |
| 36 ; | |
|
Emily Fortuna
2017/08/16 00:55:11
here too
| |
| 37 return func; | |
| 38 } | |
| 39 | |
| 40 main() { | |
| 41 readParameterInClosure(null); | |
| 42 writeParameterInClosure(null); | |
| 43 readLocalInClosure(null); | |
| 44 writeLocalInClosure(null); | |
| 45 } | |
| OLD | NEW |