@yuneta/gobj-js 7.3.4 → 7.6.5

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.
@@ -1763,8 +1763,12 @@ function gobj_read_attrs(gobj, include_flag, src) {
1763
1763
  const it = sdata_desc[i];
1764
1764
  if (!it.name) continue;
1765
1765
  if (include_flag === -1 || it.flag & include_flag) {
1766
- let jn = json_object_get(gobj.jn_attrs, it.name);
1767
- json_object_set(jn_attrs, it.name, jn);
1766
+ let value;
1767
+ if (gobj.gclass.gmt.mt_reading && !(gobj.obflag & obflag_t.obflag_destroyed)) {
1768
+ value = gobj.gclass.gmt.mt_reading(gobj, it.name);
1769
+ if (value === void 0) value = json_object_get(gobj.jn_attrs, it.name);
1770
+ } else value = json_object_get(gobj.jn_attrs, it.name);
1771
+ json_object_set(jn_attrs, it.name, value);
1768
1772
  }
1769
1773
  }
1770
1774
  return jn_attrs;