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() {
5151 this . binding = process . _debugAPI ;
5252 assert ( this . binding , 'Debugger agent running without bindings!' ) ;
5353
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 ) => {
5756 client . send ( { } , msg ) ;
5857 } ) ;
5958 } ;
@@ -68,11 +67,10 @@ Agent.prototype.onConnection = function onConnection(socket) {
6867 c . start ( ) ;
6968 this . clients . push ( c ) ;
7069
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 ) ;
7472 assert ( index !== - 1 ) ;
75- self . clients . splice ( index , 1 ) ;
73+ this . clients . splice ( index , 1 ) ;
7674 } ) ;
7775} ;
7876
@@ -99,9 +97,8 @@ function Client(agent, socket) {
9997
10098 this . on ( 'data' , this . onCommand ) ;
10199
102- var self = this ;
103- this . socket . on ( 'close' , function ( ) {
104- self . destroy ( ) ;
100+ this . socket . on ( 'close' , ( ) => {
101+ this . destroy ( ) ;
105102 } ) ;
106103}
107104util . inherits ( Client , Transform ) ;
You can’t perform that action at this time.
0 commit comments