| 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 import "dart:mock" as mock; | 4 import "dart:mock" as mock; |
| 5 | 5 |
| 6 class C1 extends core::Object { | 6 class C1 extends core::Object { |
| 7 field dynamic x; | 7 field dynamic x; |
| 8 constructor •(dynamic y) → void | 8 constructor •(dynamic y) → void |
| 9 : self::C1::x = let final mock::Context #context = new mock::Context::•(1) i
n let dynamic #t1 = #context.[]=(0, y) in new self::Closure#C1##function::•(#con
text), super core::Object::•() | 9 : self::C1::x = let final mock::Context #context = new mock::Context::•(1) i
n let dynamic #t1 = #context.[]=(0, y) in new self::Closure#C1##function::•(#con
text), super core::Object::•() |
| 10 ; | 10 ; |
| 11 } | 11 } |
| 12 class C2 extends core::Object { | 12 class C2 extends core::Object { |
| 13 field dynamic x = null; | 13 field dynamic x = null; |
| 14 constructor •(dynamic y) → void | 14 constructor •(dynamic y) → void |
| 15 : super core::Object::•() { | 15 : super core::Object::•() { |
| 16 final mock::Context #context = new mock::Context::•(1); | 16 final mock::Context #context = new mock::Context::•(1); |
| 17 #context.parent = null; | |
| 18 #context.[]=(0, y); | 17 #context.[]=(0, y); |
| 19 this.x = new self::Closure#C2#function#function::•(#context); | 18 this.x = new self::Closure#C2#function#function::•(#context); |
| 20 } | 19 } |
| 21 } | 20 } |
| 22 class Closure#C1##function extends core::Object implements core::Function { | 21 class Closure#C1##function extends core::Object implements core::Function { |
| 23 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 22 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
| 24 field mock::Context context; | 23 field mock::Context context; |
| 25 constructor •(final mock::Context context) → dynamic | 24 constructor •(final mock::Context context) → dynamic |
| 26 : self::Closure#C1##function::context = context | 25 : self::Closure#C1##function::context = context |
| 27 ; | 26 ; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 40 method call() → dynamic { | 39 method call() → dynamic { |
| 41 "This is a temporary solution. In the VM, this will become an additional par
ameter."; | 40 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
| 42 final mock::Context #contextParameter = this.{self::Closure#C2#function#func
tion::context}; | 41 final mock::Context #contextParameter = this.{self::Closure#C2#function#func
tion::context}; |
| 43 return core::print("Hello ${#contextParameter.[](0)}"); | 42 return core::print("Hello ${#contextParameter.[](0)}"); |
| 44 } | 43 } |
| 45 } | 44 } |
| 46 static method main() → dynamic { | 45 static method main() → dynamic { |
| 47 new self::C1::•("hest").x(); | 46 new self::C1::•("hest").x(); |
| 48 new self::C2::•("naebdyr").x(); | 47 new self::C2::•("naebdyr").x(); |
| 49 } | 48 } |
| OLD | NEW |