You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For events registered via once() the listener() API returns different result if longjohn is used or not.
Reproducer:
varassert=require('assert');varEventEmitter=require('events').EventEmitter;functiononListener(){}functiononceListener(){}functiontest(){vareventEmitter=newEventEmitter();eventEmitter.on('TheEvent',onListener);eventEmitter.once('TheEvent',onceListener);varlisteners=eventEmitter.listeners('TheEvent');assert.equal(listeners[0],onListener);assert.equal(listeners[1].listener,onceListener);// the following assert passes for longlohn case//assert.equal(listeners[1], onceListener); }test();require('longjohn');test();
Looks like the longlohn implementation unwraps one level too much in listen() for once listeners.
The text was updated successfully, but these errors were encountered:
For events registered via once() the listener() API returns different result if longjohn is used or not.
Reproducer:
Looks like the longlohn implementation unwraps one level too much in listen() for once listeners.
The text was updated successfully, but these errors were encountered: