Skip to content

Commit

Permalink
Implement callerlex throwing mode.
Browse files Browse the repository at this point in the history
Skips the current routine (and then any thunks) before looking for a
lexical handler. Which is precisely what Perl 6 returns need.
  • Loading branch information
jnthn committed Jun 2, 2016
1 parent 882c50d commit 018a4ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/exceptions.c
Expand Up @@ -145,6 +145,12 @@ static LocatedHandler search_for_handler_from(MVMThreadContext *tc, MVMFrame *f,
}
}
else {
if (mode == MVM_EX_THROW_LEX_CALLER) {
f = f->caller;
while (f && f->static_info->body.is_thunk)
f = f->caller;
mode = MVM_EX_THROW_LEX;
}
while (f != NULL) {
if (search_frame_handlers(tc, f, cat, payload, &lh)) {
lh.frame = f;
Expand Down

0 comments on commit 018a4ee

Please sign in to comment.