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