Skip to content

Commit 60c4c3a

Browse files
committed
dgram: don't swallow bind errors when callback is provided
Signed-off-by: armanmikoyan <arman.mikoyan1@gmail.com>
1 parent 12249cc commit 60c4c3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/dgram.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
278278
const cb = arguments.length && arguments[arguments.length - 1];
279279
if (typeof cb === 'function') {
280280
function removeListeners() {
281-
this.removeListener('error', removeListeners);
281+
this.removeListener(EventEmitter.errorMonitor, removeListeners);
282282
this.removeListener('listening', onListening);
283283
}
284284

@@ -287,7 +287,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) {
287287
FunctionPrototypeCall(cb, this);
288288
}
289289

290-
this.on('error', removeListeners);
290+
this.on(EventEmitter.errorMonitor, removeListeners);
291291
this.on('listening', onListening);
292292
}
293293

0 commit comments

Comments
 (0)