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

Side by Side Diff: pkg/kernel/testcases/closures/loop2.dart.expect

Issue 3000333002: Fix several bugs in closure conversion. (Closed)
Patch Set: 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
« no previous file with comments | « pkg/kernel/testcases/closures/loop2.dart ('k') | pkg/kernel/testcases/closures/syncstar.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 library;
2 import self as self;
3 import "dart:core" as core;
4
5 static method doit(core::int x) → void {
6 final Vector #context = MakeVector(3);
7 #context[2] = x;
8 final core::int max = 10;
9 final core::double expectedSum = max.-(1).*(max)./(2);
10 core::int counter = 0;
11 dynamic calls = <dynamic>[];
12 while (counter.<(max)) {
13 final Vector #context = MakeVector(3);
14 #context[1] = #context;
15 #context[2] = counter;
16 calls.add(MakeClosure<() → dynamic>(self::closure#doit#function, #context));
17 counter = counter.+(1);
18 }
19 core::double sum = 0.0;
20 for (dynamic c in calls)
21 sum = sum.+(c.call());
22 if(!sum.==(expectedSum))
23 throw core::Exception::•("Unexpected sum = ${sum} != ${expectedSum}");
24 }
25 static method main() → void {
26 self::doit(0);
27 }
28 static method closure#doit#function(Vector #contextParameter) → dynamic {
29 return (#contextParameter[2]).+(#contextParameter[1][2]);
30 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/closures/loop2.dart ('k') | pkg/kernel/testcases/closures/syncstar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698