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 @@ -50,9 +50,8 @@ function Agent() {
5050 this . binding = process . _debugAPI ;
5151 assert ( this . binding , 'Debugger agent running without bindings!' ) ;
5252
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 ) => {
5655 client . send ( { } , msg ) ;
5756 } ) ;
5857 } ;
@@ -67,11 +66,10 @@ Agent.prototype.onConnection = function onConnection(socket) {
6766 c . start ( ) ;
6867 this . clients . push ( c ) ;
6968
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 ) ;
7371 assert ( index !== - 1 ) ;
74- self . clients . splice ( index , 1 ) ;
72+ this . clients . splice ( index , 1 ) ;
7573 } ) ;
7674} ;
7775
@@ -98,9 +96,8 @@ function Client(agent, socket) {
9896
9997 this . on ( 'data' , this . onCommand ) ;
10098
101- var self = this ;
102- this . socket . on ( 'close' , function ( ) {
103- self . destroy ( ) ;
99+ this . socket . on ( 'close' , ( ) => {
100+ this . destroy ( ) ;
104101 } ) ;
105102}
106103util . inherits ( Client , Transform ) ;
You can’t perform that action at this time.
0 commit comments