@@ -69,7 +69,7 @@ var overrides = {
69
69
response = this . createResponse ( ) ;
70
70
}
71
71
response . success = false ;
72
- response . message = e . toString ( ) ;
72
+ response . message = e . stack ;
73
73
}
74
74
75
75
// Return the response as a JSON encoded string.
@@ -86,11 +86,11 @@ var overrides = {
86
86
'"request_seq":' + request . seq + ',' +
87
87
'"type":"response",' +
88
88
'"success":false,' +
89
- '"message":"Internal error: ' + e . toString ( ) + '"}' ;
89
+ '"message":"Internal error: ' + e . stack + '"}' ;
90
90
}
91
91
} catch ( e ) {
92
92
// Failed in one of the catch blocks above - most generic error.
93
- return '{"seq":0,"type":"response","success":false,"message":"Internal error "}' ;
93
+ return '{"seq":0,"type":"response","success":false,"message":"' + e . stack + ' "}';
94
94
}
95
95
} ,
96
96
processDebugRequest : function WRAPPED_BY_NODE_INSPECTOR ( request ) {
@@ -117,9 +117,7 @@ function V8Debug() {
117
117
this . _unwrapDebugCommandProcessor ( ) ;
118
118
this . _unshareSecurityToken ( ) ;
119
119
this . _unsetDebugEventListener ( ) ;
120
- process . nextTick ( function ( ) {
121
- this . removeAllListeners ( ) ;
122
- } . bind ( this ) ) ;
120
+ this . disableWebkitProtocol ( ) ;
123
121
} ) ;
124
122
}
125
123
@@ -150,7 +148,7 @@ V8Debug.prototype._wrapDebugCommandProcessor = function() {
150
148
extend ( proto , overrides ) ;
151
149
overrides . extendedProcessDebugJSONRequestHandles_ [ 'disconnect' ] = function ( request , response ) {
152
150
this . emit ( 'close' ) ;
153
- this . processDebugJSONRequest ( request ) ;
151
+ proto . processDebugJSONRequest ( request ) ;
154
152
} . bind ( this ) ;
155
153
} ;
156
154
@@ -286,9 +284,9 @@ V8Debug.prototype.enableWebkitProtocol = function() {
286
284
response . event = command ;
287
285
288
286
new WebkitEventCallback ( callback ) ( request , response ) ;
287
+ this . unregisterCommand ( handlerName ) ;
289
288
} . bind ( this ) ) ;
290
289
this . sendCommand ( handlerName ) ;
291
- this . unregisterCommand ( handlerName ) ;
292
290
} ;
293
291
294
292
this . wrapCallFrames = function ( execState , maximumLimit , scopeDetails ) {
@@ -335,6 +333,13 @@ V8Debug.prototype.enableWebkitProtocol = function() {
335
333
}
336
334
} ;
337
335
336
+ V8Debug . prototype . disableWebkitProtocol = function ( ) {
337
+ if ( ! this . _webkitProtocolEnabled ) return ;
338
+ this . _webkitProtocolEnabled = false ;
339
+
340
+ this . runInDebugContext ( 'ToggleMirrorCache()' ) ;
341
+ } ;
342
+
338
343
V8Debug . prototype . releaseObject =
339
344
V8Debug . prototype . releaseObjectGroup =
340
345
V8Debug . prototype . wrapCallFrames =
0 commit comments