| OLD | NEW |
| 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>(closure#main#f, #context); |
| 32 final () → dynamic g = new self::Closure#main#g::•(#context); | 7 final () → dynamic g = MakeClosure<() → dynamic>(closure#main#g, #context); |
| 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 } |
| OLD | NEW |