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

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

Issue 2778223002: Add primitive to create closures and use it for closure conversion (Closed)
Patch Set: Skip context param in closure type construction, rather than remove it Created 3 years, 8 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
1 library; 1 library;
2 import self as self; 2 import self as self;
3 import "dart:core" as core;
4 3
5 class Closure#main#f extends core::Object implements core::Function {
6 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
7 field Vector context;
8 constructor •(final Vector context) → dynamic
9 : self::Closure#main#f::context = context
10 ;
11 method call() → dynamic {
12 "This is a temporary solution. In the VM, this will become an additional par ameter.";
13 final Vector #contextParameter = this.{self::Closure#main#f::context};
14 return null;
15 }
16 }
17 class Closure#main#g extends core::Object implements core::Function {
18 field core::String note = "This is temporary. The VM doesn't need closure clas ses.";
19 field Vector context;
20 constructor •(final Vector context) → dynamic
21 : self::Closure#main#g::context = context
22 ;
23 method call() → dynamic {
24 "This is a temporary solution. In the VM, this will become an additional par ameter.";
25 final Vector #contextParameter = this.{self::Closure#main#g::context};
26 return (#contextParameter[1]).call();
27 }
28 }
29 static method main(dynamic arguments) → dynamic { 4 static method main(dynamic arguments) → dynamic {
30 final Vector #context = MakeVector(2); 5 final Vector #context = MakeVector(2);
31 #context[1] = new self::Closure#main#f::•(#context); 6 #context[1] = MakeClosure<() → dynamic>(self::closure#main#f, #context);
32 final () → dynamic g = new self::Closure#main#g::•(#context); 7 final () → dynamic g = MakeClosure<() → dynamic>(self::closure#main#g, #contex t);
33 g.call(); 8 g.call();
34 } 9 }
10 static method closure#main#f(Vector #contextParameter) → dynamic {
11 return null;
12 }
13 static method closure#main#g(Vector #contextParameter) → dynamic {
14 return (#contextParameter[1]).call();
15 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698