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