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 C extends core::Object { | 6 class C extends core::Object { |
7 field dynamic t; | 7 field dynamic t; |
8 constructor foo(dynamic f) → void | 8 constructor foo(dynamic f) → void |
9 : self::C::t = let final mock::Context #context = new mock::Context::•(1) in
let dynamic #t1 = #context.[]=(0, f) in new self::Closure#C#foo#function::•(#co
ntext), super core::Object::•() { | 9 : self::C::t = let final mock::Context #context = new mock::Context::•(1) in
let dynamic #t1 = #context.[]=(0, f) in new self::Closure#C#foo#function::•(#co
ntext), super core::Object::•() { |
10 final mock::Context #context = new mock::Context::•(1); | 10 final mock::Context #context = new mock::Context::•(1); |
11 #context.parent = null; | |
12 #context.[]=(0, f); | 11 #context.[]=(0, f); |
13 core::print(1); | 12 core::print(1); |
14 } | 13 } |
15 } | 14 } |
16 class Closure#C#foo#function extends core::Object implements core::Function { | 15 class Closure#C#foo#function extends core::Object implements core::Function { |
17 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 16 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
18 field mock::Context context; | 17 field mock::Context context; |
19 constructor •(final mock::Context context) → dynamic | 18 constructor •(final mock::Context context) → dynamic |
20 : self::Closure#C#foo#function::context = context | 19 : self::Closure#C#foo#function::context = context |
21 ; | 20 ; |
(...skipping 15 matching lines...) Expand all Loading... |
37 return core::print("hest"); | 36 return core::print("hest"); |
38 } | 37 } |
39 } | 38 } |
40 static method main() → dynamic { | 39 static method main() → dynamic { |
41 core::print(0); | 40 core::print(0); |
42 dynamic c = new self::C::foo(new self::Closure#main#function::•(null)); | 41 dynamic c = new self::C::foo(new self::Closure#main#function::•(null)); |
43 core::print(2); | 42 core::print(2); |
44 c.t(); | 43 c.t(); |
45 core::print(3); | 44 core::print(3); |
46 } | 45 } |
OLD | NEW |