| OLD | NEW |
| 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 constructor •() → void | 7 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(2); | 11 final Vector #context = MakeVector(2); |
| 12 #context[1] = this; | 12 #context[1] = 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(2); | 16 final Vector #context = MakeVector(2); |
| 17 #context[1] = this; | 17 #context[1] = 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(Vector #contextParameter, dynamic v) → dynami
c { |
| 32 return (#contextParameter[1]).x = v; | 32 return (#contextParameter[1]).x = v; |
| 33 } | 33 } |
| 34 static method closure#C#f#function#function(Vector #contextParameter) → dynamic
{ | 34 static method closure#C#f#function#function(Vector #contextParameter) → dynamic
{ |
| 35 return (#contextParameter[1]).x; | 35 return (#contextParameter[1]).x; |
| 36 } | 36 } |
| 37 static method closure#C#f#function(Vector #contextParameter) → dynamic { | 37 static method closure#C#f#function(Vector #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 } |
| OLD | NEW |