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:
Eric Kreutzer 2016-06-28 16:10:48 -07:00 committed by Facebook Github Bot
parent 1762426e9c
commit 73bea8f7e6
1 changed files with 2 additions and 2 deletions

View File

@ -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);
});
}