Skip to content

Fix EventEmitter prototype-key event types - #58229

Closed
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-event-emitter-prototype-events
Closed

Fix EventEmitter prototype-key event types#58229
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-event-emitter-prototype-events

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

The shared EventEmitter uses an ordinary object registry, so event types such as constructor and __proto__ resolve inherited values and throw during registration. Initialize and reset the internal registry without a prototype, and cover registration, emission, counting, and full reset for both keys.

Fixes #58228.

Changelog:

[GENERAL] [FIXED] - Support EventEmitter event names that overlap Object prototype properties.

Test Plan:

  • Exact upstream regression: 20 passed / 1 failed at registrations.add.
  • Fixed Fantom suite: 21/21 passed.
  • Fresh yarn flow-check: 0 errors.
  • Targeted no-ignore ESLint, Prettier, and git diff --check passed.

No UI change; screenshots are not applicable.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
@meta-codesync

meta-codesync Bot commented Sep 1, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D118267117.

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 790289c Sep 1, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 1, 2026
@meta-codesync

meta-codesync Bot commented Sep 1, 2026

Copy link
Copy Markdown

@javache merged this pull request in 790289c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventEmitter rejects event names inherited from Object.prototype

2 participants