}
static void
+mouse_report_unmatched_keys(pTHX_ SV* const meta, AV* const attrs, HV* const args) {
+ HV* const attr_map = newHV_mortal();
+ I32 const len = AvFILLp(attrs) + 1;
+ I32 i;
+ SV* const unknown = newSVpvs_flags("", SVs_TEMP);
+ HE* he;
+
+ for(i = 0; i < len; i++){
+ SV* const attr = MOUSE_av_at(attrs, i);
+ (void)hv_store_ent(attr_map, mcall0(attr, mouse_name), &PL_sv_yes, 0U);
+ }
+
+ hv_iterinit(args);
+ while((he = hv_iternext(args))){
+ SV* const key = hv_iterkeysv(he);
+ if(!hv_exists_ent(attr_map, key, 0U)){
+ sv_catpvf(unknown, " %"SVf",", key);
+ }
+ }
+ SvCUR(unknown)--; /* chop "," */
+ mouse_throw_error(meta, NULL,
+ "Unknown attribute init_arg passed to the constructor of %"SVf": %"SVf,
+ mcall0(meta, mouse_name), unknown);
+}
+
+static void
mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const args, bool const ignore_triggers) {
AV* const xc = mouse_get_xc(aTHX_ meta);
AV* const attrs = MOUSE_xc_attrall(xc);
I32 len = AvFILLp(attrs) + 1;
I32 i;
+ I32 used = 0;
AV* triggers_queue = NULL;
assert(meta || object);
av_push(triggers_queue, (SV*)pair);
}
+
+ used++;
}
else { /* no init arg */
if(flags & (MOUSEf_ATTR_HAS_DEFAULT | MOUSEf_ATTR_HAS_BUILDER)){
}
}
+ if(used < HvUSEDKEYS(args)){
+ mouse_report_unmatched_keys(aTHX_ meta, attrs, args);
+ }
+
if(MOUSE_xc_flags(xc) & MOUSEf_XC_IS_ANON){
set_slot(object, newSVpvs_flags("__METACLASS__", SVs_TEMP), meta);
}