You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When hashing a (class based) object with a getter, object-hash try to get the actual property value, while in fact it's calculated. So when doing it with wsWebSocket class, it goes to its prototype and finally to the extensions getter, throwsing an exception because this._extensions is undefined since its initialized in its constructor. Here we have several alternatives:
consider the exception as the property value, and serialize it
swallow the exception, and ignore the property
detect it's a property getter with getOwnPropertyDescriptor, and serialize its function with a getter: prefix
I think the best option is the last one, since it's the most attached to the code. Since we are using Object.keys(), there would not be overlap with getters set at prototype or class level, and the place to check and serialize the getter with the getter: prefix and the serialized getter function object should be in place of fetching its value when accesing to the object attributes values.
I think this issue can be related to #49, #81, #84, and #72
The text was updated successfully, but these errors were encountered:
When hashing a (
class
based) object with a getter,object-hash
try to get the actual property value, while in fact it's calculated. So when doing it with wsWebSocket
class, it goes to its prototype and finally to theextensions
getter, throwsing an exception becausethis._extensions
isundefined
since its initialized in its constructor. Here we have several alternatives:getter:
prefixI think the best option is the last one, since it's the most attached to the code. Since we are using Object.keys(), there would not be overlap with getters set at prototype or class level, and the place to check and serialize the getter with the
getter:
prefix and the serialized getter function object should be in place of fetching its value when accesing to the object attributes values.I think this issue can be related to #49, #81, #84, and #72
The text was updated successfully, but these errors were encountered: