reference".
p4raw-id: //depot/perl@30806
&& SvOBJECT(ob))))
{
Perl_croak(aTHX_ "Can't call method \"%s\" on unblessed reference",
+ (SvSCREAM(meth) && strEQ(name,"isa")) ? "DOES" :
name);
}
require "./test.pl";
}
-plan tests => 110;
+plan tests => 111;
$a = {};
bless $a, "Bob";
Bodine->isa('Pig');
*isa = \&UNIVERSAL::isa;
eval { isa({}, 'HASH') };
-::is($@, '', "*isa correctly found")
+::is($@, '', "*isa correctly found");
+
+package main;
+eval { UNIVERSAL::DOES([], "foo") };
+like( $@, qr/Can't call method "DOES" on unblessed reference/,
+ 'DOES call error message says DOES, not isa' );
{
const char *classname;
bool does_it;
+ SV *methodname;
dSP;
ENTER;
XPUSHs(sv_2mortal(newSVpv(name, 0)));
PUTBACK;
- call_method("isa", G_SCALAR);
+ methodname = sv_2mortal(newSVpv("isa", 0));
+ /* ugly hack: use the SvSCREAM flag so S_method_common
+ * can figure out we're calling DOES() and not isa(),
+ * and report eventual errors correctly. --rgs */
+ SvSCREAM_on(methodname);
+ call_sv(methodname, G_SCALAR | G_METHOD);
SPAGAIN;
does_it = SvTRUE( TOPs );