else{
I32 i;
- args = newHV_mortal();
-
if( (items % 2) != 0 ){
if(!metaclass){ metaclass = get_metaclass(klass); }
mouse_throw_error(metaclass, NULL, "Odd number of parameters to new()");
}
+ args = newHV_mortal();
for(i = 0; i < items; i += 2){
(void)hv_store_ent(args, ST(i), newSVsv(ST(i+1)), 0U);
}
if(MOUSE_xc_flags(xc) & MOUSEf_XC_IS_ANON){
(void)set_slot(object, newSVpvs_flags("__METACLASS__", SVs_TEMP), meta);
}
-
}
static SV*
SV* meta = get_metaclass(klass);
if(!SvOK(meta)){
- meta = mcall1s(newSVpvs_flags("Mouse::Meta::Class", SVs_TEMP), "initialize", klass);
+ meta = mcall1s(newSVpvs_flags("Mouse::Meta::Class", SVs_TEMP),
+ "initialize", klass);
}
return meta;
ENTER;
SAVETMPS;
- xa = newAV();
+ xa = newAV();
mg = sv_magicext(SvRV(attr), (SV*)xa, PERL_MAGIC_ext, &mouse_xa_vtbl, NULL, 0);
SvREFCNT_dec(xa); /* refcnt++ in sv_magicext */
"without a default, builder, or an init_arg", name);
}
- /* taken from Mouse::Meta::Attribute->new and ->_process_args */
+ /* taken from Mouse::Meta::Attribute->new and ->_process_args */
svp = hv_fetchs(args, "is", FALSE);
if(svp){
sv_setsv(*svp, name);
}
else if(strEQ(is, "bare")){
- /* do nothing, but don't complain (later) about missing methods */
+ /* do nothing, but might complain later about missing methods */
}
else{
mouse_throw_error(klass, NULL,