X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs%2FMethod.xs;h=5ffa4677e7733af1f69259aeb9c32ee294fff4cb;hb=dfa11004a2d5ffded0323bb85317ed444a90d2ac;hp=590cd06f3ffa438fafd8ce244859911137f6390d;hpb=38bf2a2585e26a47c919fd4c286b7716acb51c00;p=gitmo%2FMoose.git diff --git a/xs/Method.xs b/xs/Method.xs index 590cd06..5ffa467 100644 --- a/xs/Method.xs +++ b/xs/Method.xs @@ -8,3 +8,16 @@ BOOT: INSTALL_SIMPLE_READER(Method, name); INSTALL_SIMPLE_READER(Method, package_name); INSTALL_SIMPLE_READER(Method, body); + +bool +is_stub(self) + SV *self + + PREINIT: + CV *const body = (CV *)SvRV( HeVAL( hv_fetch_ent((HV *)SvRV(self), KEY_FOR(body), 0, HASH_FOR(body)) ) ); + + CODE: + RETVAL = !( CvISXSUB(body) || CvROOT(body) ); + + OUTPUT: + RETVAL