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

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

Issue 2999003002: Add more tested features to closure_test (Closed)
Patch Set: Updated cf. comments. 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 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 }
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