diff --git a/src/cswinrt/code_writers.h b/src/cswinrt/code_writers.h index dab3687f1..f930e7d66 100644 --- a/src/cswinrt/code_writers.h +++ b/src/cswinrt/code_writers.h @@ -498,6 +498,17 @@ namespace cswinrt w.write("default(%)", bind(semantics)); } + void write_event_out_defaults(writer& w, method_signature const& methodSig) + { + for (auto&& param : methodSig.params()) + { + if (get_param_category(param) == param_category::out || get_param_category(param) == param_category::receive_array) + { + w.write("\n% = default(%);", bind(param), bind(get_type_semantics(param.second->Type()))); + } + } + } + void write_event_invoke_args(writer& w, method_signature const& methodSig) { w.write("%", bind_list(", ", methodSig.params())); @@ -6471,7 +6482,7 @@ handler = (%) => { var localDel = _event; if (localDel == null) -{ +{% return %; } %localDel.Invoke(%); @@ -6488,6 +6499,7 @@ return handler; eventTypeCode, bind(eventTypeSemantics), bind(invokeMethodSig), + bind(invokeMethodSig), bind(invokeMethodSig), bind(invokeMethodSig), bind(invokeMethodSig));