Skip to content

Commit d3eac92

Browse files
committed
Leveraged $emit instead of emit internally.
1 parent fb5b9bc commit d3eac92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/namespace.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ SocketNamespace.prototype.send = function (data) {
181181
*/
182182

183183
SocketNamespace.prototype.emit = function (name) {
184-
if (name == 'connection' || name == 'newListener') {
184+
if (name == 'newListener') {
185185
return this.$emit.apply(this, arguments);
186186
}
187187

@@ -287,7 +287,7 @@ SocketNamespace.prototype.handlePacket = function (sessid, packet) {
287287
socket.packet({ type: 'connect' });
288288

289289
// emit connection event
290-
self.emit('connection', socket);
290+
self.$emit('connection', socket);
291291
};
292292

293293
switch (packet.type) {
@@ -333,7 +333,7 @@ SocketNamespace.prototype.handlePacket = function (sessid, packet) {
333333
this.manager.onLeave(sessid, this.name);
334334
this.store.publish('leave', sessid, this.name);
335335

336-
socket.emit('disconnect', packet.reason || 'packet');
336+
socket.$emit('disconnect', packet.reason || 'packet');
337337
break;
338338

339339
case 'json':
@@ -343,6 +343,6 @@ SocketNamespace.prototype.handlePacket = function (sessid, packet) {
343343
if (dataAck)
344344
params.push(ack);
345345

346-
socket.emit.apply(socket, params);
346+
socket.$emit.apply(socket, params);
347347
};
348348
};

0 commit comments

Comments
 (0)