-
-
Notifications
You must be signed in to change notification settings - Fork 4k
fix(PollAnswer): only define _emoji property once #10811
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
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.
Pull Request Overview
This PR fixes the error "TypeError: Cannot redefine property: _emoji" by modifying how the _emoji property is defined and updated in PollAnswer.js. The key changes are:
- The _emoji property is now defined only once with writable set to true.
- The subsequent update of _emoji uses a direct assignment instead of re-defining the property.
Comments suppressed due to low confidence (1)
packages/discord.js/src/structures/PollAnswer.js:42
- Ensure that making _emoji writable does not allow unintended external modifications elsewhere. If strict encapsulation is required, consider providing controlled access via a getter/setter.
Object.defineProperty(this, '_emoji', { value: null, writable: true });
This causes an error
TypeError: Cannot redefine property: _emoji
.