Fixes EventEmitter#once arguments not getting passed to the listener
Summary: Arrow functions do not have their own arguments. Fix EventEmitter#once to pass the correct arguments to the listener callback. Closes https://github.com/facebook/react-native/pull/8479 Differential Revision: D3495086 Pulled By: javache fbshipit-source-id: 4492d13bfb2cc255afdc41d39fbf2f35da6b7094
This commit is contained in:
parent
1762426e9c
commit
73bea8f7e6
|
@ -78,9 +78,9 @@ class EventEmitter {
|
|||
* listener
|
||||
*/
|
||||
once(eventType: string, listener: Function, context: ?Object): EmitterSubscription {
|
||||
return this.addListener(eventType, () => {
|
||||
return this.addListener(eventType, (...args) => {
|
||||
this.removeCurrentListener();
|
||||
listener.apply(context, arguments);
|
||||
listener.apply(context, args);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue