| Index: pkg/kernel/testcases/closures/closure_in_initializer.dart.expect
|
| diff --git a/pkg/kernel/testcases/closures/closure_in_initializer.dart.expect b/pkg/kernel/testcases/closures/closure_in_initializer.dart.expect
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f92bacc3d4d9420ea54c732de8e0e4f1135465f1
|
| --- /dev/null
|
| +++ b/pkg/kernel/testcases/closures/closure_in_initializer.dart.expect
|
| @@ -0,0 +1,46 @@
|
| +library;
|
| +import self as self;
|
| +import "dart:core" as core;
|
| +import "dart:mock" as mock;
|
| +
|
| +class C extends core::Object {
|
| + field dynamic t;
|
| + constructor foo(dynamic f) → void
|
| + : 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::•(#context), super core::Object::•() {
|
| + final mock::Context #context = new mock::Context::•(1);
|
| + #context.parent = null;
|
| + #context.[]=(0, f);
|
| + core::print(1);
|
| + }
|
| +}
|
| +class Closure#C#foo#function extends core::Object implements core::Function {
|
| + field core::String note = "This is temporary. The VM doesn't need closure classes.";
|
| + field mock::Context context;
|
| + constructor •(final mock::Context context) → dynamic
|
| + : self::Closure#C#foo#function::context = context
|
| + ;
|
| + method call() → dynamic {
|
| + "This is a temporary solution. In the VM, this will become an additional parameter.";
|
| + final mock::Context #contextParameter = this.{self::Closure#C#foo#function::context};
|
| + return #contextParameter.[](0).call();
|
| + }
|
| +}
|
| +class Closure#main#function extends core::Object implements core::Function {
|
| + field core::String note = "This is temporary. The VM doesn't need closure classes.";
|
| + field mock::Context context;
|
| + constructor •(final mock::Context context) → dynamic
|
| + : self::Closure#main#function::context = context
|
| + ;
|
| + method call() → dynamic {
|
| + "This is a temporary solution. In the VM, this will become an additional parameter.";
|
| + final mock::Context #contextParameter = this.{self::Closure#main#function::context};
|
| + return core::print("hest");
|
| + }
|
| +}
|
| +static method main() → dynamic {
|
| + core::print(0);
|
| + dynamic c = new self::C::foo(new self::Closure#main#function::•(null));
|
| + core::print(2);
|
| + c.t();
|
| + core::print(3);
|
| +}
|
|
|