Skip to content

Commit

Permalink
Fixes EventEmitter#once arguments not getting passed to the listener
Browse files Browse the repository at this point in the history
Summary:
Arrow functions do not have their own arguments. Fix EventEmitter#once to pass the correct arguments to the listener callback.
Closes #8479

Differential Revision: D3495086

Pulled By: javache

fbshipit-source-id: 4492d13bfb2cc255afdc41d39fbf2f35da6b7094
  • Loading branch information
erickreutz authored and Facebook Github Bot committed Jun 28, 2016
1 parent 1762426 commit 73bea8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/EventEmitter/EventEmitter.js
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit 73bea8f

Please sign in to comment.