Description
The shared React Native EventEmitter stores listener registrations in an ordinary object. Valid string event names such as constructor and __proto__ therefore resolve inherited prototype values; addListener attempts to call .add on them and throws before registration.
Expected behavior
Every valid string key should be independently registrable, emitted, counted, and cleared, including names that overlap Object.prototype. removeAllListeners() should reset to the same prototype-free registry.
React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All
Description
The shared React Native EventEmitter stores listener registrations in an ordinary object. Valid string event names such as
constructorand__proto__therefore resolve inherited prototype values;addListenerattempts to call.addon them and throws before registration.Expected behavior
Every valid string key should be independently registrable, emitted, counted, and cleared, including names that overlap Object.prototype.
removeAllListeners()should reset to the same prototype-free registry.React Native Version
0.87.1 and current main
Affected Platforms
JavaScript runtime - All