deepFreeze don't freeze non enumerable props
Closed this issue · 7 comments
If object contains non enumerable prop with object value, it will not be frozen by deepFreeze.
Freezing of non enumerable properties is available from v3.0.0
Major version has been published because as side effect option to deepFreeze prototype chain has also been removed (braking change). { proto: true }
is not longer available because of undesired side effects. For more information on it reference v3.0.0 relese
{ proto: true }
was dangerous but great feature. I'll miss it :)
I will review it one more time and and consider bringing it back if I find some nice way of avoiding side effects (freezing built in JavaScript objects and their properties).
As I see these side effects can be avoided by stopping prototype chain on one having constructor
property. So we can freeze all properties of prototype objects, but not freeze "prototype classes" (including things like global.Object
etc.).
This way if you freeze an array length
will be frozen but map
will not.
look my get-props for example.
@astur Thanks for information i will investigate it.
I'm also open to contributions if you want to contribute to it?
Looks safe enough. Good.