| 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 Closure#main#function extends core::Object implements core::Function { | 6 class Closure#main#function extends core::Object implements core::Function { |
| 7 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; | 7 field core::String note = "This is temporary. The VM doesn't need closure clas
ses."; |
| 8 field mock::Context context; | 8 field mock::Context context; |
| 9 constructor •(final mock::Context context) → dynamic | 9 constructor •(final mock::Context context) → dynamic |
| 10 : self::Closure#main#function::context = context | 10 : self::Closure#main#function::context = context |
| 11 ; | 11 ; |
| 12 method call() → dynamic { | 12 method call() → dynamic { |
| 13 "This is a temporary solution. In the VM, this will become an additional par
ameter."; | 13 "This is a temporary solution. In the VM, this will become an additional par
ameter."; |
| 14 final mock::Context #contextParameter = this.{self::Closure#main#function::c
ontext}; | 14 final mock::Context #contextParameter = this.{self::Closure#main#function::c
ontext}; |
| 15 core::print(#contextParameter.[](0)); | 15 core::print(#contextParameter.[](0)); |
| 16 if(!#contextParameter.[](1).==(null)) | 16 if(!#contextParameter.[](1).==(null)) |
| 17 core::print(#contextParameter.[](1)); | 17 core::print(#contextParameter.[](1)); |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 static method main() → dynamic { | 20 static method main() → dynamic { |
| 21 dynamic c; | 21 dynamic c; |
| 22 try { | 22 try { |
| 23 throw "Fisk"; | 23 throw "Fisk"; |
| 24 } | 24 } |
| 25 on core::String catch(dynamic #t1, dynamic #t2) { | 25 on core::String catch(dynamic #t1, dynamic #t2) { |
| 26 final mock::Context #context = new mock::Context::•(2); | 26 final mock::Context #context = new mock::Context::•(2); |
| 27 #context.parent = null; | |
| 28 #context.[]=(0, #t1); | 27 #context.[]=(0, #t1); |
| 29 #context.[]=(1, #t2); | 28 #context.[]=(1, #t2); |
| 30 c = new self::Closure#main#function::•(#context); | 29 c = new self::Closure#main#function::•(#context); |
| 31 } | 30 } |
| 32 c.call(); | 31 c.call(); |
| 33 core::print("TEST PASSED"); | 32 core::print("TEST PASSED"); |
| 34 } | 33 } |
| OLD | NEW |