* Class::MOP::Class
- Add get_all_method_names (Sartak)
+ * Class::MOP::Package
+ - Disable deprecated get_all_package_symbols in list context. (Florian
+ Ragwitz)
+
0.76 Thu, January 22, 2008
* Class::MOP::Method::Generated
- Added new private methods to support code generation, which
XSRETURN_EMPTY;
}
-
PUTBACK;
if ( (he = hv_fetch_ent((HV *)SvRV(self), key_package, 0, hash_package)) ) {
if (!stash) {
- switch (GIMME_V) {
- case G_SCALAR: XSRETURN_UNDEF; break;
- case G_ARRAY: XSRETURN_EMPTY; break;
- }
+ XSRETURN_UNDEF;
}
symbols = get_all_package_symbols(stash, filter);
-
- switch (GIMME_V) {
- case G_SCALAR:
- PUSHs(sv_2mortal(newRV_inc((SV *)symbols)));
- break;
- case G_ARRAY:
- warn("Class::MOP::Package::get_all_package_symbols in list context is deprecated. use scalar context instead.");
-
- EXTEND(SP, HvKEYS(symbols) * 2);
-
- while ((he = hv_iternext(symbols))) {
- PUSHs(hv_iterkeysv(he));
- PUSHs(sv_2mortal(SvREFCNT_inc(HeVAL(he))));
- }
-
- break;
- default:
- break;
- }
-
- SvREFCNT_dec((SV *)symbols);
+ PUSHs(sv_2mortal(newRV_noinc((SV *)symbols)));
void
name(self)
my $namespace = $self->namespace;
- if (wantarray) {
- warn 'Class::MOP::Package::get_all_package_symbols in list context is deprecated. use scalar context instead.';
- }
-
- return (wantarray ? %$namespace : $namespace) unless defined $type_filter;
+ return $namespace unless defined $type_filter;
my %ret;
# for some reason this nasty impl is orders of magnitude faster than a clean version
} keys %$namespace;
}
- return wantarray ? %ret : \%ret;
+ return \%ret;
}
1;