| Index: pkg/kernel/testcases/closures/closure_in_constructor.dart.expect
|
| diff --git a/pkg/kernel/testcases/closures/closure_in_constructor.dart.expect b/pkg/kernel/testcases/closures/closure_in_constructor.dart.expect
|
| index 983514d6718d806d5dea3804a00fbae634af86ba..1a630caa12c1d43ac2938b35d535e40c3a9fa119 100644
|
| --- a/pkg/kernel/testcases/closures/closure_in_constructor.dart.expect
|
| +++ b/pkg/kernel/testcases/closures/closure_in_constructor.dart.expect
|
| @@ -5,7 +5,7 @@ import "dart:core" as core;
|
| class C1 extends core::Object {
|
| field dynamic x;
|
| constructor •(dynamic y) → void
|
| - : self::C1::x = let final Vector #context = MakeVector(2) in let dynamic #t1 = #context[1] = y in new self::Closure#C1##function::•(#context), super core::Object::•()
|
| + : self::C1::x = let final Vector #context = MakeVector(2) in let dynamic #t1 = #context[1] = y in MakeClosure<() → dynamic>(self::closure#C1##function, #context), super core::Object::•()
|
| ;
|
| }
|
| class C2 extends core::Object {
|
| @@ -14,34 +14,16 @@ class C2 extends core::Object {
|
| : super core::Object::•() {
|
| final Vector #context = MakeVector(2);
|
| #context[1] = y;
|
| - this.x = new self::Closure#C2#function#function::•(#context);
|
| - }
|
| -}
|
| -class Closure#C1##function extends core::Object implements core::Function {
|
| - field core::String note = "This is temporary. The VM doesn't need closure classes.";
|
| - field Vector context;
|
| - constructor •(final Vector context) → dynamic
|
| - : self::Closure#C1##function::context = context
|
| - ;
|
| - method call() → dynamic {
|
| - "This is a temporary solution. In the VM, this will become an additional parameter.";
|
| - final Vector #contextParameter = this.{self::Closure#C1##function::context};
|
| - return core::print("Hello ${#contextParameter[1]}");
|
| - }
|
| -}
|
| -class Closure#C2#function#function extends core::Object implements core::Function {
|
| - field core::String note = "This is temporary. The VM doesn't need closure classes.";
|
| - field Vector context;
|
| - constructor •(final Vector context) → dynamic
|
| - : self::Closure#C2#function#function::context = context
|
| - ;
|
| - method call() → dynamic {
|
| - "This is a temporary solution. In the VM, this will become an additional parameter.";
|
| - final Vector #contextParameter = this.{self::Closure#C2#function#function::context};
|
| - return core::print("Hello ${#contextParameter[1]}");
|
| + this.x = MakeClosure<() → dynamic>(self::closure#C2#function#function, #context);
|
| }
|
| }
|
| static method main() → dynamic {
|
| new self::C1::•("hest").x();
|
| new self::C2::•("naebdyr").x();
|
| }
|
| +static method closure#C1##function(Vector #contextParameter) → dynamic {
|
| + return core::print("Hello ${#contextParameter[1]}");
|
| +}
|
| +static method closure#C2#function#function(Vector #contextParameter) → dynamic {
|
| + return core::print("Hello ${#contextParameter[1]}");
|
| +}
|
|
|