-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hoek.clone() issues #228
Comments
Another type that could use special handling is I know that due to lazy evaluation, reading the Object.defineProperty(newObj, 'stack', {
configurable: true,
get() {
return obj.stack;
},
set(value) {
Object.defineProperty(newObj, 'stack', {
configurable: true,
writable: true,
value
});
}
}); See https://bugs.chromium.org/p/v8/issues/detail?id=5962 for a bit of background. |
yup, clone hasn't been updated for newer types (even as new as good catch on cloned non-enumerable properties becoming enumerable though! |
For completeness: |
It's also problematic for complex types such as sockets, I ran into this this |
@SimonSchick Yeah, any object with hidden state won't work unless explicitly added. It's only designed to work for "simple" objects. |
@kanongil any plans on fixing this? |
The enumerable issue is fixed with 6f02157. |
The Symbol issue should be fixed with #281. |
const Hoek = require('hoek') The result is : Map {} |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
I happened to look into the
clone()
implementation, and found several critical issues in my review:Map
/Set
values are completely broken.Does not cloneSymbol()
properties on object. Can be found usingObject.getOwnPropertySymbols()
.Non-enumerable properties are.enumerable
on cloned objectPromise
values are broken.The text was updated successfully, but these errors were encountered: