File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,8 @@ function Agent() {
51
51
this . binding = process . _debugAPI ;
52
52
assert ( this . binding , 'Debugger agent running without bindings!' ) ;
53
53
54
- var self = this ;
55
- this . binding . onmessage = function ( msg ) {
56
- self . clients . forEach ( function ( client ) {
54
+ this . binding . onmessage = ( msg ) => {
55
+ this . clients . forEach ( ( client ) => {
57
56
client . send ( { } , msg ) ;
58
57
} ) ;
59
58
} ;
@@ -68,11 +67,10 @@ Agent.prototype.onConnection = function onConnection(socket) {
68
67
c . start ( ) ;
69
68
this . clients . push ( c ) ;
70
69
71
- var self = this ;
72
- c . once ( 'close' , function ( ) {
73
- var index = self . clients . indexOf ( c ) ;
70
+ c . once ( 'close' , ( ) => {
71
+ var index = this . clients . indexOf ( c ) ;
74
72
assert ( index !== - 1 ) ;
75
- self . clients . splice ( index , 1 ) ;
73
+ this . clients . splice ( index , 1 ) ;
76
74
} ) ;
77
75
} ;
78
76
@@ -99,9 +97,8 @@ function Client(agent, socket) {
99
97
100
98
this . on ( 'data' , this . onCommand ) ;
101
99
102
- var self = this ;
103
- this . socket . on ( 'close' , function ( ) {
104
- self . destroy ( ) ;
100
+ this . socket . on ( 'close' , ( ) => {
101
+ this . destroy ( ) ;
105
102
} ) ;
106
103
}
107
104
util . inherits ( Client , Transform ) ;
You can’t perform that action at this time.
0 commit comments