Skip to content

Commit a8821a0

Browse files
committed
Clear up ambiguous use of 'try block'
Way back in 2001 several tests were added to t/op/goto.t which referred to a concept called a 'try block': commit 9c5794f Author: Robin Houston <[email protected]> AuthorDate: Wed Mar 14 01:52:51 2001 +0000 Commit: Jarkko Hietaniemi <[email protected]> CommitDate: Wed Mar 14 02:41:54 2001 +0000 ... diff --git a/t/op/goto.t b/t/op/goto.t index 246184c..6f9e349 100755 --- a/t/op/goto.t +++ b/t/op/goto.t ... +# Does goto work correctly within a try block? That language is still in use in two files -- but since we now have a 'try' keyword and a feature 'try', such language is now ambiguous. Here we change 'try block' to 'eval block' in those test descriptions and comments where we're clearly speaking about 'eval BLOCK'.
1 parent f04eb08 commit a8821a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pp_ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2388,7 +2388,7 @@ PP_wrapped(pp_caller, MAXARG, 0)
23882388
mPUSHs(newSVsv(cx->blk_eval.old_namesv));
23892389
PUSHs(&PL_sv_yes);
23902390
}
2391-
/* eval BLOCK (try blocks have old_namesv == 0) */
2391+
/* eval BLOCK (eval blocks have old_namesv == 0) */
23922392
else {
23932393
PUSHs(&PL_sv_undef);
23942394
PUSHs(&PL_sv_undef);

t/op/goto.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ FORL2: for($y=1; 1;) {
136136
goto FORL2;
137137
}
138138

139-
# Does goto work correctly within a try block?
139+
# Does goto work correctly within a eval block?
140140
# (BUG ID 20000313.004) - [perl #2359]
141141
my $ok = 0;
142142
eval {
143143
my $variable = 1;
144144
goto LABEL20;
145145
LABEL20: $ok = 1 if $variable;
146146
};
147-
ok($ok, 'works correctly within a try block');
147+
ok($ok, 'works correctly within a eval block');
148148
is($@, "", '...and $@ not set');
149149

150150
# And within an eval-string?

0 commit comments

Comments
 (0)