Skip to content
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

fix: ensure that files/folders whose names are properties of Object.prototype are packaged/extracted correctly #253

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

erikian
Copy link
Member

@erikian erikian commented Dec 6, 2022

As noted in #235, folders (and also files) named constructor were not being packaged. This happened because the objects holding the directory tree were being created with {}, which inherits all properties from Object.prototype, such as constructor and __proto__, so when trying to add a folder named constructor, it was assumed it already existed. Now we're creating these objects without a prototype with Object.create(null), so there shouldn't be any more conflicts.

Fixes #235.

@erikian
Copy link
Member Author

erikian commented Dec 6, 2022

Pretty sure the test failure is git messing with me, I'll check it out when I get a chance

@erikian
Copy link
Member Author

erikian commented Dec 6, 2022

Turns out it was an issue with the trailing line endings my editor was adding, looks like Windows on CI was creating a file with line endings which were different from the ones in my local Windows? Anyway, the PR is ready to review now.

@erickzhao erickzhao requested a review from a team December 12, 2022 18:47
@erikian erikian force-pushed the fix/properties-from-prototype branch from 9768cf0 to 1b9315a Compare September 23, 2023 12:35
Copy link
Member

@BlackHole1 BlackHole1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. /cc @electron/wg-ecosystem

@erikian erikian force-pushed the fix/properties-from-prototype branch from 1b9315a to 63f6794 Compare September 27, 2023 00:24
@erikian erikian merged commit ecde48e into electron:main Sep 27, 2023
3 checks passed
@erikian erikian deleted the fix/properties-from-prototype branch September 27, 2023 00:30
@continuous-auth
Copy link

🎉 This PR is included in version 3.2.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Folders named constructor not being packed properly
3 participants