Skip to content

Fix EventEmitter prototype-key event types - #58229

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

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
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. 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

1 participant