This repository was archived by the owner on Apr 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -359,8 +359,8 @@ export interface ResolvedDebugAgentConfig extends GoogleAuthOptions {
359359 apiUrl ?: string ;
360360
361361 /**
362- * Number of times of the V8 pause events (could be breakpoint hits) before
363- * resetting the breakpoints . This is to release the memory usage held by V8
362+ * Number of times the V8 pauses (could be breakpoint hits) before the
363+ * debugging session is reset . This is to release the memory usage held by V8
364364 * engine for each breakpoint hit to prevent the memory leak. The default
365365 * value is specified in defaultConfig.
366366 */
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export class InspectorDebugApi implements debugapi.DebugApi {
8888 this . fileStats = jsFiles ;
8989 this . sourcemapper = sourcemapper ;
9090 this . inspector = new V8Inspector (
91- /* useWellFormattedUrl =*/ logger ,
91+ /* logger =*/ logger ,
9292 /*useWellFormattedUrl=*/ utils . satisfies ( process . version , '>10.11.0' ) ,
9393 /*resetV8DebuggerThreshold=*/ this . config . resetV8DebuggerThreshold ,
9494 /*onScriptParsed=*/
Original file line number Diff line number Diff line change @@ -158,13 +158,16 @@ export class V8Inspector {
158158 session . post ( 'Debugger.setBreakpointsActive' , { active : true } ) ;
159159 session . on ( 'Debugger.paused' , message => {
160160 this . onPaused ( message . params ) ;
161- this . resetV8DebuggerIfMeetThreshold ( ) ;
161+ this . resetV8DebuggerIfThresholdMet ( ) ;
162162 } ) ;
163163
164164 this . session = session ;
165165 }
166166
167- /** Detaches from the V8 debugger. */
167+ /**
168+ * Detaches from the V8 debugger. This will purge all the existing V8
169+ * breakpoints from the V8 debugger.
170+ */
168171 detach ( ) {
169172 if ( ! this . session ) {
170173 return ;
@@ -177,11 +180,11 @@ export class V8Inspector {
177180 }
178181
179182 /**
180- * Resets the debugging session when the threshold. This is primarily for
181- * cleaning the memory usage hold by V8 debugger when hitting the V8
182- * breakpoints too many times.
183+ * Resets the debugging session when the number of paused events meets the
184+ * threshold. This is primarily for cleaning the memory usage hold by V8
185+ * debugger when hitting the V8 breakpoints too many times.
183186 */
184- private resetV8DebuggerIfMeetThreshold ( ) {
187+ private resetV8DebuggerIfThresholdMet ( ) {
185188 this . numPausedBeforeReset += 1 ;
186189 if ( this . numPausedBeforeReset < this . resetV8DebuggerThreshold ) {
187190 return ;
You can’t perform that action at this time.
0 commit comments