MCPcopy Index your code
hub / github.com/nodejs/node / showBreakPoints

Method showBreakPoints

deps/v8/test/debugger/test-api.js:145–169  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

143 }
144
145 showBreakPoints(f) {
146 const source = %FunctionGetSourceCode(f);
147 const offset = %FunctionGetScriptSourcePosition(f);
148 const locations = %GetBreakLocations(f);
149
150 if (!locations) return source;
151
152 locations.sort(function(x, y) { return x - y; });
153
154 let result = "";
155 let prev_pos = 0;
156 let pos;
157
158 for (var i = 0; i < locations.length; i++) {
159 pos = locations[i] - offset;
160 result += source.slice(prev_pos, pos);
161 result += "[B" + i + "]";
162 prev_pos = pos;
163 }
164
165 pos = source.length;
166 result += source.substring(prev_pos, pos);
167
168 return result;
169 }
170
171 debuggerFlags() {
172 return { breakPointsActive :

Calls 2

sortMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected