-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
External objects should not be modified #7655
Comments
I don't know of any written rule but I agree that we should not modify user-supplied objects. |
We can solve this problem for |
Another way is to do |
@thefourtheye yes, it would be a good place to add a solution for the
|
@thefourtheye as I know from #7208 and #7255 |
@micnic Right. I use |
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs#7831 Fixes: nodejs#7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
Fixed in 7542bdd |
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: #7831 Fixes: #7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs/node#7831 Fixes: nodejs/node#7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs/node#7831 Fixes: nodejs/node#7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
This patch makes a copy of the `options` object before the fs module functions alter it. PR-URL: nodejs/node#7831 Fixes: nodejs/node#7655 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Nicu Micleușanu <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
Hey, I was playing around with
Object.seal()
andObject.freeze()
and discovered that internally Node is trying to modify my objects and I got the following infs.watch
:In my opinion external objects should not be modified by Node, as I observed sometimes this rule is respected, sometimes - only partially (in case of
fs.appendFile
).Do we have anywhere this rule specified?
cc @nodejs/collaborators
The text was updated successfully, but these errors were encountered: