Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
fs: simplify copy operations and more cleanups#31038
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot commented Dec 24, 2019
BridgeAR commented Dec 26, 2019
I noticed late that there's actually a test added in #635 that checks that inherited properties are checked as well as fs option (this will likely not work everywhere but at least in streams). I decided to remove the failing test. I think it's a good idea not to fall back to the prototype but this seems to be a breaking change. |
Trott commented Dec 27, 2019
@nodejs/fs |
Trott commented Dec 27, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Trott commented Dec 28, 2019
Removing the |
This is mainly a minor refactoring to reduce the code overhead with the side effect of removing support for prototype properties in passed through options. Copying options is mostly done for enumerable own properties and prototype properties are ignored.
BridgeAR commented Jan 12, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Jan 12, 2020
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I‘m not sure I understand the breaking change. Can you please articulate it further? What would break?
BridgeAR commented Jan 20, 2020
@mcollina inherited object properties won't be accepted as options anymore. So if you do e.g.: |
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think doing a breaking change for a refactoring is worth it in this case.
BridgeAR commented Jan 20, 2020
@mcollina the question is if we want to officially support inherited properties or not. I was quite surprised when I noticed the failure that we allowed something like that. AFAIK we do not have any guarantees of supporting inherited properties in any other API. We partially prevent this actively to prevent attacks based on prototype pollution and there are open PRs to do this even more: #30008 and #30063. I guess it might be a good for the @nodejs/tsc to weight in if we want to generically support inherited properties or if we should instead actively recommend against relying on any prototype properties while passing through options. I am fine to close this if others want to keep the current behavior. // cc @watson |
mcollina commented Jan 20, 2020
I'm happy with the change as long as it is clearly spelled out and it's a direction we would like the project to go. |
8ae28ff to 2935f72Comparelundibundi commented Sep 2, 2020
mcollina commented Sep 3, 2020
@lundibundi everybody can add the tsc-agenda tag. May I ask to formulate a question to the tsc when you do so? Are you asking for a vote on this? My take on the -1 is on the breakage for the sake of a refactoring, which is the description of this PR. |
lundibundi commented Sep 4, 2020
I think the question would be (only partially related to this PR): AFAIK none of our APIs provide any explicit guarantees of supporting inherited properties in @BridgeAR could you please clarify if the above is correct? (feel free to just edit this comment) |
This is just a minor refactoring to reduce the code overhead.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes