File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -19,22 +19,6 @@ var parser = require('./parser')
19
19
20
20
exports = module . exports = Socket ;
21
21
22
- /**
23
- * Reserved event names.
24
- */
25
-
26
- var events = {
27
- message : 1
28
- , connect : 1
29
- , disconnect : 1
30
- , open : 1
31
- , close : 1
32
- , error : 1
33
- , retry : 1
34
- , reconnect : 1
35
- , newListener : 1
36
- } ;
37
-
38
22
/**
39
23
* Socket constructor.
40
24
*
@@ -149,7 +133,7 @@ Socket.prototype.setFlags = function () {
149
133
150
134
Socket . prototype . onDisconnect = function ( reason ) {
151
135
if ( ! this . disconnected ) {
152
- this . emit ( 'disconnect' , reason ) ;
136
+ this . $ emit( 'disconnect' , reason ) ;
153
137
this . disconnected = true ;
154
138
}
155
139
} ;
@@ -342,7 +326,7 @@ Socket.prototype.$emit = EventEmitter.prototype.emit;
342
326
*/
343
327
344
328
Socket . prototype . emit = function ( ev ) {
345
- if ( events [ ev ] ) {
329
+ if ( ev == 'newListener' ) {
346
330
return this . $emit . apply ( this , arguments ) ;
347
331
}
348
332
You can’t perform that action at this time.
0 commit comments