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: use defineProperty for appending prop in storeName #194

Merged
merged 4 commits into from Mar 3, 2022
Merged

fix: use defineProperty for appending prop in storeName #194

merged 4 commits into from Mar 3, 2022

Conversation

Jack-Works
Copy link
Contributor

@mourner
Copy link
Collaborator

mourner commented Nov 26, 2021

Can you please explain this in more detail? Why is this fix needed?

@Jack-Works
Copy link
Contributor Author

Can you please explain this in more detail? Why is this fix needed?

In a secured environment, all built-in prototypes are frozen, including Object.prototype.

image

In this case, this.storedNames[key] = true will throw if key is isPrototypeOf which is on the Object.prototype.

@antfu
Copy link
Collaborator

antfu commented Mar 2, 2022

@Jack-Works Can you give permission for maintainers to edit this PR (here should be a check box on this page)? We can't rebase this PR to the latest branch.

@Jack-Works
Copy link
Contributor Author

@antfu I didn't find that check box but I manually merge with the latest commit

@antfu antfu changed the title chore: use define property fix: use defineProperty for appending prop in storeName Mar 3, 2022
@antfu antfu merged commit 96b7cd3 into Rich-Harris:master Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lockdown: not working with rollup
3 participants