| Index: pkg/kernel/testcases/closures/non_void_context.dart.expect
|
| diff --git a/pkg/kernel/testcases/closures/non_void_context.dart.expect b/pkg/kernel/testcases/closures/non_void_context.dart.expect
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d7059b85e449a197ee07f6ad1c9be8b69a2949f5
|
| --- /dev/null
|
| +++ b/pkg/kernel/testcases/closures/non_void_context.dart.expect
|
| @@ -0,0 +1,52 @@
|
| +library;
|
| +import self as self;
|
| +import "dart:core" as core;
|
| +import "dart:mock" as mock;
|
| +
|
| +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 x) → 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 self::v = let final dynamic #t1 = #contextParameter in let final dynamic #t2 = 0 in let final dynamic #t3 = x in let final dynamic #t4 = #t1.[]=(#t2, #t3) in #t3;
|
| + }
|
| +}
|
| +class Closure#main#function#1 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#1::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#1::context};
|
| + for (; let final dynamic #t5 = #contextParameter in let final dynamic #t6 = 0 in let final dynamic #t7 = self::v in let final dynamic #t8 = #t5.[]=(#t6, #t7) in #t7; ) {
|
| + self::v = false;
|
| + }
|
| + }
|
| +}
|
| +static field dynamic v = null;
|
| +static method main(dynamic arguments) → dynamic {
|
| + final mock::Context #context = new mock::Context::•(1);
|
| + #context.parent = null;
|
| + #context.[]=(0, null);
|
| + new self::Closure#main#function::•(#context).call(87);
|
| + if(!self::v.==(87)) {
|
| + throw "Unexpected value in v: ${self::v}";
|
| + }
|
| + if(!#context.[](0).==(87)) {
|
| + throw "Unexpected value in w: ${#context.[](0)}";
|
| + }
|
| + self::v = true;
|
| + new self::Closure#main#function#1::•(#context).call();
|
| + if(!self::v.==(false)) {
|
| + throw "Unexpected value in v: ${self::v}";
|
| + }
|
| + if(!#context.[](0).==(false)) {
|
| + throw "Unexpected value in w: ${#context.[](0)}";
|
| + }
|
| +}
|
|
|