4 # This test checks for $@ being set early during an exceptional
5 # unwinding, and that this early setting doesn't affect the late
6 # setting used to emit the exception from eval{}. The early setting is
7 # a backward-compatibility hack to satisfy modules that were relying on
8 # the historical early setting in order to detect exceptional unwinding.
9 # This hack should be removed when a proper way to detect exceptional
10 # unwinding has been developed.
16 print $_[0] ? "" : "not ", "ok ", ++$test_num, "\n";
21 sub DESTROY { $_[0]->() }
24 return bless(sub { $cleanup->() }, "End");
28 my($uerr, $val, $err);
32 my $c = end { $uerr = $@; $@ = "t2\n"; };
42 my $c = end { $uerr = $@; $@ = "t2\n"; };
51 my $c = end { $uerr = $@; $@ = "t2\n"; };
64 my $c = end { $uerr = $@; $@ = "t2\n"; };