--- parser3/tests/457.html 2026/09/26 17:51:49 1.1
+++ parser3/tests/457.html 2026/09/26 19:09:06 1.2
@@ -1,7 +1,7 @@
-# The request gets one recovery reserve (feature #1298)
+# The request gets recovery reserve many times (feature #1298)
@main[][i]
-$report[ $.caught(0) $.finally(0) $.after(false) ]
-^for[i](1;10){
+$report[ $.caught(0) $.finally(0) ]
+^for[i](1;5){
$calls(0)
^try{^recurse[]}{
$report.caught($report.caught+1)
@@ -12,6 +12,31 @@ $report[ $.caught(0) $.finally(0) $.afte
}
}
$report.after(true)
+
+# the handler itself may run away and recover on its own
+^try{^recurse[]}{
+ ^try{^recurse[]}{
+ $report.caught_in_catch(true)
+ $exception.handled(true)
+ }
+ $exception.handled(true)
+}
+
+# the handler runs away too, yet finally still gets its own reserve
+^try{
+ ^try{^recurse[]}{
+ ^recurse[]
+ }{
+ ^try{^recurse[]}{
+ $report.caught_in_finally(true)
+ $exception.handled(true)
+ }
+ }
+}{
+ $report.catch_error_propagated(true)
+ $report.finally_error[$exception.comment]
+ $exception.handled(true)
+}
^json:string[$report; $.indent(true)]
@recurse[]
@@ -20,6 +45,5 @@ $calls($calls+1)
@unhandled_exception[exception;stack]
$exception.handled(true)
-$report.final_calls($calls)
$report.error[$exception.comment]
^json:string[$report; $.indent(true)]