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