Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: tests/compiler/dart2js/closure/data/captured_variable.dart

Issue 2999003002: Add more tested features to closure_test (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/closure/closure_test.dart ('k') | tests/compiler/dart2js/closure/data/parameter_in_try.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698