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 x = null; | 7 field dynamic x = null; |
8 constructor •() → void | 8 constructor •() → void |
9 : super core::Object::•() | 9 : super core::Object::•() |
10 ; | 10 ; |
11 method m() → dynamic { | 11 method m() → dynamic { |
12 final mock::Context #context = new mock::Context::•(1); | 12 final mock::Context #context = new mock::Context::•(1); |
13 #context.parent = null; | |
14 #context.[]=(0, this); | 13 #context.[]=(0, this); |
15 return new self::Closure#C#m#function::•(#context); | 14 return new self::Closure#C#m#function::•(#context); |
16 } | 15 } |
17 method f() → dynamic { | 16 method f() → dynamic { |
18 final mock::Context #context = new mock::Context::•(1); | 17 final mock::Context #context = new mock::Context::•(1); |
19 #context.parent = null; | |
20 #context.[]=(0, this); | 18 #context.[]=(0, this); |
21 return new self::Closure#C#f#function::•(#context); | 19 return new self::Closure#C#f#function::•(#context); |
22 } | 20 } |
23 } | 21 } |
24 class Closure#C#m#function extends core::Object implements core::Function { | 22 class Closure#C#m#function extends core::Object implements core::Function { |
25 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 23 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
26 field mock::Context context; | 24 field mock::Context context; |
27 constructor •(final mock::Context context) → dynamic | 25 constructor •(final mock::Context context) → dynamic |
28 : self::Closure#C#m#function::context = context | 26 : self::Closure#C#m#function::context = context |
29 ; | 27 ; |
(...skipping 30 matching lines...) Expand all Loading... |
60 static method main() → dynamic { | 58 static method main() → dynamic { |
61 self::C c = new self::C::•(); | 59 self::C c = new self::C::•(); |
62 c.x = 41; | 60 c.x = 41; |
63 c.m().call(42); | 61 c.m().call(42); |
64 if(!42.==(c.x)) | 62 if(!42.==(c.x)) |
65 throw "Unexpected value in c.x: ${c.x}"; | 63 throw "Unexpected value in c.x: ${c.x}"; |
66 dynamic result = c.f().call().call(); | 64 dynamic result = c.f().call().call(); |
67 if(!42.==(result)) | 65 if(!42.==(result)) |
68 throw "Unexpected value from c.f()()(): ${result}"; | 66 throw "Unexpected value from c.f()()(): ${result}"; |
69 } | 67 } |
OLD | NEW |