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 Closure#main#g extends core::Object implements core::Function { | 6 class Closure#main#g extends core::Object implements core::Function { |
7 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 7 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
8 field mock::Context context; | 8 field mock::Context context; |
9 constructor •(final mock::Context context) → dynamic | 9 constructor •(final mock::Context context) → dynamic |
10 : self::Closure#main#g::context = context | 10 : self::Closure#main#g::context = context |
11 ; | 11 ; |
12 method call(dynamic x) → dynamic { | 12 method call(dynamic x) → dynamic { |
13 "This is a temporary solution. In the VM, this will become an additional par
ameter."; | 13 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
14 final mock::Context #contextParameter = this.{self::Closure#main#g::context}
; | 14 final mock::Context #contextParameter = this.{self::Closure#main#g::context}
; |
15 return #contextParameter.[](0).[](x); | 15 return #contextParameter.[](0).[](x); |
16 } | 16 } |
17 } | 17 } |
18 static field dynamic f = null; | 18 static field dynamic f = null; |
19 static method foo() → dynamic { | 19 static method foo() → dynamic { |
20 core::print(self::f.call(0)); | 20 core::print(self::f.call(0)); |
21 } | 21 } |
22 static method main(dynamic arguments) → dynamic { | 22 static method main(dynamic arguments) → dynamic { |
23 final mock::Context #context = new mock::Context::•(1); | 23 final mock::Context #context = new mock::Context::•(1); |
24 #context.parent = null; | 24 #context.parent = null; |
25 #context.[]=(0, arguments); | 25 #context.[]=(0, arguments); |
26 final(dynamic) → dynamic g = new self::Closure#main#g::•(#context); | 26 final (dynamic) → dynamic g = new self::Closure#main#g::•(#context); |
27 self::f = g; | 27 self::f = g; |
28 self::foo(); | 28 self::foo(); |
29 } | 29 } |
OLD | NEW |