github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/testdata/recover.txt (about)

     1  # simple recover
     2  running panic...
     3  recovering...
     4  recovered: panic
     5  
     6  # recover with result
     7  running panic...
     8  recovered: panic
     9  result: 3
    10  
    11  # nested defer frame
    12  deferred nested function
    13  recovered: panic
    14  
    15  # nested panic: panic inside recover
    16  recovered 1: panic
    17  recovered 2: foo
    18  
    19  # panic inside defer
    20  recovered: panic
    21  
    22  # panic replace
    23  panic 1
    24  panic 2
    25  recovered: panic 2