if (!has_arg)
RETURN;
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
- GV * const cvgv = CvGV(dbcx->blk_sub.cv);
/* So is ccstack[dbcxix]. */
- if (cvgv && isGV(cvgv)) {
- SV * const sv = newSV(0);
- gv_efullname3(sv, cvgv, NULL);
- mPUSHs(sv);
+ if (CvHASGV(dbcx->blk_sub.cv)) {
+ PUSHs(cv_name(dbcx->blk_sub.cv, 0));
PUSHs(boolSV(CxHASARGS(cx)));
}
else {
*bar::is = *is;
*bar::like = *like;
}
-plan 135;
+plan 137;
# -------------------- Errors with feature disabled -------------------- #
is runperl(switches => ['-lXMfeature=:all'],
prog => 'state sub x {}; undef &x; print defined &x',
stderr => 1), "\n", 'undefining state sub';
+{
+ state sub x { is +(caller 0)[3], 'x', 'state sub name in caller' }
+ x
+}
# -------------------- my -------------------- #
is runperl(switches => ['-lXMfeature=:all'],
prog => 'my sub x {}; undef &x; print defined &x',
stderr => 1), "\n", 'undefining my sub';
+{
+ my sub x { is +(caller 0)[3], 'x', 'my sub name in caller' }
+ x
+}
# -------------------- Interactions (and misc tests) -------------------- #