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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/testcases/closures/loop2.dart.expect
diff --git a/pkg/kernel/testcases/closures/loop2.dart.expect b/pkg/kernel/testcases/closures/loop2.dart.expect
new file mode 100644
index 0000000000000000000000000000000000000000..13fbab74c35c7b8673b1e3fc6974ec3fed5cf4ff
--- /dev/null
+++ b/pkg/kernel/testcases/closures/loop2.dart.expect
@@ -0,0 +1,30 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method doit(core::int x) → void {
+ final Vector #context = MakeVector(3);
+ #context[2] = x;
+ final core::int max = 10;
+ final core::double expectedSum = max.-(1).*(max)./(2);
+ core::int counter = 0;
+ dynamic calls = <dynamic>[];
+ while (counter.<(max)) {
+ final Vector #context = MakeVector(3);
+ #context[1] = #context;
+ #context[2] = counter;
+ calls.add(MakeClosure<() → dynamic>(self::closure#doit#function, #context));
+ counter = counter.+(1);
+ }
+ core::double sum = 0.0;
+ for (dynamic c in calls)
+ sum = sum.+(c.call());
+ if(!sum.==(expectedSum))
+ throw core::Exception::•("Unexpected sum = ${sum} != ${expectedSum}");
+}
+static method main() → void {
+ self::doit(0);
+}
+static method closure#doit#function(Vector #contextParameter) → dynamic {
+ return (#contextParameter[2]).+(#contextParameter[1][2]);
+}
« 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