@yuneta/gobj-js 7.13.2 → 7.13.4

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.
@@ -1579,7 +1579,7 @@ function gobj_play(gobj) {
1579
1579
  let ret = 0;
1580
1580
  if (gobj.gclass.gmt.mt_play) {
1581
1581
  ret = gobj.gclass.gmt.mt_play(gobj);
1582
- if (ret < 0) gobj.playing = false;
1582
+ if (ret < 0 || ret === false) gobj.playing = false;
1583
1583
  }
1584
1584
  return ret;
1585
1585
  }
@@ -2713,7 +2713,8 @@ function gobj_subscribe_event(publisher, event, kw, subscriber) {
2713
2713
  if (kw) trace_json(kw);
2714
2714
  }
2715
2715
  if (publisher.gclass.gmt.mt_subscription_added) {
2716
- if (publisher.gclass.gmt.mt_subscription_added(publisher, subs) < 0) {
2716
+ let result = publisher.gclass.gmt.mt_subscription_added(publisher, subs);
2717
+ if (result < 0 || result === false) {
2717
2718
  _delete_subscription(publisher, subs, true, true);
2718
2719
  subs = 0;
2719
2720
  }
@@ -2862,7 +2863,7 @@ function gobj_publish_event(publisher, event, kw) {
2862
2863
  if (publisher.gclass.gmt.mt_publication_pre_filter) {
2863
2864
  let topublish = publisher.gclass.gmt.mt_publication_pre_filter(publisher, subs, event, kw);
2864
2865
  if (topublish < 0) break;
2865
- else if (topublish === 0) continue;
2866
+ else if (!topublish) continue;
2866
2867
  }
2867
2868
  let subscriber = kw_get_pointer(publisher, subs, "subscriber", null, kw_flag_t.KW_REQUIRED);
2868
2869
  if (!(subscriber && !gobj_is_destroying(subscriber))) continue;
@@ -2877,14 +2878,14 @@ function gobj_publish_event(publisher, event, kw) {
2877
2878
  let topublish = 1;
2878
2879
  if (publisher.gclass.gmt.mt_publication_filter) topublish = publisher.gclass.gmt.mt_publication_filter(publisher, event, kw2publish, subscriber);
2879
2880
  else if (json_size(__filter__) > 0) {
2880
- topublish = kw_match_simple(kw2publish, __filter__);
2881
+ topublish = kw_match_simple(kw2publish, __filter__) ? 1 : 0;
2881
2882
  if (tracea) {
2882
2883
  trace_machine(sprintf("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", topublish ? "👍" : "👎", event ? event : "", gobj_short_name(subscriber), gobj_short_name(publisher)));
2883
2884
  trace_json(__filter__);
2884
2885
  }
2885
2886
  }
2886
2887
  if (topublish < 0) break;
2887
- else if (topublish === 0) continue;
2888
+ else if (!topublish) continue;
2888
2889
  let ev_ = gobj_event_type(subscriber, event, true);
2889
2890
  if (ev_) {
2890
2891
  if (ev_.event_flag & event_flag_t.EVF_SYSTEM_EVENT) {