@yuneta/gobj-js 7.3.4 → 7.6.6

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.
@@ -1766,8 +1766,12 @@
1766
1766
  const it = sdata_desc[i];
1767
1767
  if (!it.name) continue;
1768
1768
  if (include_flag === -1 || it.flag & include_flag) {
1769
- let jn = json_object_get(gobj.jn_attrs, it.name);
1770
- json_object_set(jn_attrs, it.name, jn);
1769
+ let value;
1770
+ if (gobj.gclass.gmt.mt_reading && !(gobj.obflag & obflag_t.obflag_destroyed)) {
1771
+ value = gobj.gclass.gmt.mt_reading(gobj, it.name);
1772
+ if (value === void 0) value = json_object_get(gobj.jn_attrs, it.name);
1773
+ } else value = json_object_get(gobj.jn_attrs, it.name);
1774
+ json_object_set(jn_attrs, it.name, value);
1771
1775
  }
1772
1776
  }
1773
1777
  return jn_attrs;
@@ -1998,9 +2002,9 @@
1998
2002
  *
1999
2003
  ***************************************************************************/
2000
2004
  function gobj_current_state(gobj) {
2001
- if (gobj_is_destroying(gobj)) {
2002
- log_error("gobj NULL or DESTROYED");
2003
- return null;
2005
+ if (!is_gobj(gobj)) {
2006
+ log_error("hgobj NULL");
2007
+ return "";
2004
2008
  }
2005
2009
  return gobj.current_state.state_name;
2006
2010
  }
@@ -5480,7 +5484,13 @@
5480
5484
  let priv = gobj.priv;
5481
5485
  clear_timeout(priv.gobj_timer);
5482
5486
  gobj_stop(priv.gobj_timer);
5483
- if (priv.websocket) close_websocket(gobj);
5487
+ if (priv.websocket) {
5488
+ priv.websocket.onopen = null;
5489
+ priv.websocket.onmessage = null;
5490
+ priv.websocket.onerror = null;
5491
+ priv.websocket.onclose = null;
5492
+ close_websocket(gobj);
5493
+ }
5484
5494
  return 0;
5485
5495
  }
5486
5496
  /***************************************************************