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

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

Issue 2561723003: Merge kernel closure conversion into the Dart SDK (Closed)
Patch Set: Remove path constraint Created 4 years 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/uncaptured_for_in_loop.dart ('k') | pkg/pkg.status » ('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 import "dart:mock" as mock;
5
6 class Closure#main#function extends core::Object implements core::Function {
7 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
8 field mock::Context context;
9 constructor •(final mock::Context context) → dynamic
10 : self::Closure#main#function::context = context
11 ;
12 method call() → dynamic {
13 "This is a temporary solution. In the VM, this will become an additional par ameter.";
14 final mock::Context #contextParameter = this.{self::Closure#main#function::c ontext};
15 return #contextParameter.[](0);
16 }
17 }
18 static const field dynamic numbers = const <core::int>[0, 1, 2, 3, 4, 5, 6, 7, 8 , 9];
19 static method main() → dynamic {
20 dynamic closures = <dynamic>[];
21 for (core::int i in self::numbers) {
22 final mock::Context #context = new mock::Context::•(1);
23 #context.parent = null;
24 #context.[]=(0, i);
25 closures.add(new self::Closure#main#function::•(#context));
26 }
27 core::int sum = 0;
28 for (core::Function f in closures) {
29 sum = sum.+(f.call());
30 }
31 core::int expectedSum = self::numbers.length.-(1).*(self::numbers.length).~/(2 );
32 if(!expectedSum.==(sum)) {
33 throw core::Exception::•("Unexpected sum = ${sum} != ${expectedSum}");
34 }
35 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/closures/uncaptured_for_in_loop.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698