@yuneta/gobj-js 7.25.7 → 7.25.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2957,11 +2957,10 @@
2957
2957
  let __global__ = kw_get_dict(publisher, subs, "__global__", null, 0);
2958
2958
  let __local__ = kw_get_dict(publisher, subs, "__local__", null, 0);
2959
2959
  let __filter__ = kw_get_dict_value(publisher, subs, "__filter__", null, 0);
2960
- let kw2publish = kw;
2961
2960
  let topublish = 1;
2962
- if (publisher.gclass.gmt.mt_publication_filter) topublish = publisher.gclass.gmt.mt_publication_filter(publisher, event, kw2publish, subscriber);
2961
+ if (publisher.gclass.gmt.mt_publication_filter) topublish = publisher.gclass.gmt.mt_publication_filter(publisher, event, kw, subscriber);
2963
2962
  else if (json_size(__filter__) > 0) {
2964
- topublish = kw_match_simple(kw2publish, __filter__) ? 1 : 0;
2963
+ topublish = kw_match_simple(kw, __filter__) ? 1 : 0;
2965
2964
  if (tracea) {
2966
2965
  trace_machine(sprintf("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", topublish ? "👍" : "👎", event ? event : "", gobj_short_name(subscriber), gobj_short_name(publisher)));
2967
2966
  trace_json(__filter__);
@@ -2975,9 +2974,11 @@
2975
2974
  if (!gobj_has_event(subscriber, ev_.event_name, 0)) continue;
2976
2975
  }
2977
2976
  }
2978
- if (__local__) kw_pop(kw2publish, __local__);
2977
+ let kw2publish = kw;
2978
+ if (json_size(__local__) > 0 || json_size(__global__) > 0) kw2publish = Object.assign({}, kw);
2979
+ if (json_size(__local__) > 0) kw_pop(kw2publish, __local__);
2979
2980
  if (__config__) {}
2980
- if (__global__) json_object_update(kw2publish, __global__);
2981
+ if (json_size(__global__) > 0) json_object_update(kw2publish, json_deep_copy(__global__));
2981
2982
  if (tracea) {
2982
2983
  if (__trace_machine_format__ === 1) trace_machine(sprintf("🔝🔄 %s (%s) %s%s", event ? event : "", event ? event : "", !subscriber.running ? "!!" : "", gobj_short_name(subscriber)));
2983
2984
  else trace_machine(sprintf("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", !subscriber.running ? "!!" : "", gobj_short_name(subscriber), gobj_current_state(subscriber), event ? event : "", publisher && !publisher.running ? "!!" : "", gobj_short_name(publisher)));
@@ -6710,7 +6711,8 @@
6710
6711
  window.console.error(`Not in session`);
6711
6712
  return -1;
6712
6713
  }
6713
- if (!kw) kw = {};
6714
+ kw = Object.assign({}, is_object(kw) ? kw : {});
6715
+ if (is_object(kw["__md_iev__"])) kw["__md_iev__"] = json_deep_copy(kw["__md_iev__"]);
6714
6716
  if (msg_iev_get_stack(gobj, kw, IEVENT_STACK_ID)) {} else {
6715
6717
  let jn_ievent_id = build_cli_ievent_request(gobj, gobj_name(src), kw_get_str(gobj, kw, "__service__", 0, 0));
6716
6718
  json_object_del(kw, "__service__");