Index: pkg/kernel/testcases/closures/catch.dart.expect |
diff --git a/pkg/kernel/testcases/closures/catch.dart.expect b/pkg/kernel/testcases/closures/catch.dart.expect |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1081d5b640ca72e4fccc5c5119c599a61dacb829 |
--- /dev/null |
+++ b/pkg/kernel/testcases/closures/catch.dart.expect |
@@ -0,0 +1,34 @@ |
+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 { |
+ "This is a temporary solution. In the VM, this will become an additional parameter."; |
+ final mock::Context #contextParameter = this.{self::Closure#main#function::context}; |
+ core::print(#contextParameter.[](0)); |
+ if(!#contextParameter.[](1).==(null)) |
+ core::print(#contextParameter.[](1)); |
+ } |
+} |
+static method main() → dynamic { |
+ dynamic c; |
+ try { |
+ throw "Fisk"; |
+ } |
+ on core::String catch(dynamic #t1, dynamic #t2) { |
+ final mock::Context #context = new mock::Context::•(2); |
+ #context.parent = null; |
+ #context.[]=(0, #t1); |
+ #context.[]=(1, #t2); |
+ c = new self::Closure#main#function::•(#context); |
+ } |
+ c.call(); |
+ core::print("TEST PASSED"); |
+} |