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

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

Issue 3007623002: Fix many bugs with closure conversion in checked mode. (Closed)
Patch Set: Review comments Created 3 years, 3 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; 3 import "dart:core" as core;
4 4
5 class C extends core::Object { 5 class C extends core::Object {
6 field dynamic x = null; 6 field dynamic x = null;
7 default constructor •() → void 7 default constructor •() → void
8 : super core::Object::•() 8 : super core::Object::•()
9 ; 9 ;
10 method m() → dynamic { 10 method m() → dynamic {
11 final Vector #context = MakeVector(3); 11 final dynamic #context = MakeVector(3);
12 #context[2] = this; 12 #context[2] = this;
13 return MakeClosure<(dynamic) → dynamic>(self::closure#C#m#function, #context ); 13 return MakeClosure<(dynamic) → dynamic>(self::closure#C#m#function, #context );
14 } 14 }
15 method f() → dynamic { 15 method f() → dynamic {
16 final Vector #context = MakeVector(3); 16 final dynamic #context = MakeVector(3);
17 #context[2] = this; 17 #context[2] = this;
18 return MakeClosure<() → dynamic>(self::closure#C#f#function, #context); 18 return MakeClosure<() → dynamic>(self::closure#C#f#function, #context);
19 } 19 }
20 } 20 }
21 static method main() → dynamic { 21 static method main() → dynamic {
22 self::C c = new self::C::•(); 22 self::C c = new self::C::•();
23 c.x = 41; 23 c.x = 41;
24 c.m().call(42); 24 c.m().call(42);
25 if(!42.==(c.x)) 25 if(!42.==(c.x))
26 throw "Unexpected value in c.x: ${c.x}"; 26 throw "Unexpected value in c.x: ${c.x}";
27 dynamic result = c.f().call().call(); 27 dynamic result = c.f().call().call();
28 if(!42.==(result)) 28 if(!42.==(result))
29 throw "Unexpected value from c.f()()(): ${result}"; 29 throw "Unexpected value from c.f()()(): ${result}";
30 } 30 }
31 static method closure#C#m#function(Vector #contextParameter, dynamic v) → dynami c { 31 static method closure#C#m#function(dynamic #contextParameter, dynamic v) → dynam ic {
32 return (#contextParameter[2]).x = v; 32 return (#contextParameter[2]).x = v;
33 } 33 }
34 static method closure#C#f#function#function(Vector #contextParameter) → dynamic { 34 static method closure#C#f#function#function(dynamic #contextParameter) → dynamic {
35 return (#contextParameter[2]).x; 35 return (#contextParameter[2]).x;
36 } 36 }
37 static method closure#C#f#function(Vector #contextParameter) → dynamic { 37 static method closure#C#f#function(dynamic #contextParameter) → dynamic {
38 return MakeClosure<() → dynamic>(self::closure#C#f#function#function, #context Parameter); 38 return MakeClosure<() → dynamic>(self::closure#C#f#function#function, #context Parameter);
39 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698