MCPcopy Create free account
hub / github.com/nodejs/node / logBreakLocations

Method logBreakLocations

deps/v8/test/inspector/protocol-test.js:342–366  ·  view source on GitHub ↗
(inputLocations)

Source from the content-addressed store, hash-verified

340 }
341
342 async logBreakLocations(inputLocations) {
343 let locations = inputLocations.slice();
344 let scriptId = locations[0].scriptId;
345 let script = await this.getScriptWithSource(scriptId);
346 let lines = script.scriptSource.split('\n');
347 locations = locations.sort((loc1, loc2) => {
348 if (loc2.lineNumber !== loc1.lineNumber) return loc2.lineNumber - loc1.lineNumber;
349 return loc2.columnNumber - loc1.columnNumber;
350 });
351 for (let location of locations) {
352 let line = lines[location.lineNumber];
353 line = line.slice(0, location.columnNumber) + locationMark(location.type) + line.slice(location.columnNumber);
354 lines[location.lineNumber] = line;
355 }
356 lines = lines.filter(line => line.indexOf('//# sourceURL=') === -1);
357 InspectorTest.log(lines.join('\n') + '\n');
358 return inputLocations;
359
360 function locationMark(type) {
361 if (type === 'return') return '|R|';
362 if (type === 'call') return '|C|';
363 if (type === 'debuggerStatement') return '|D|';
364 return '|_|';
365 }
366 }
367
368 async logTypeProfile(typeProfile, source) {
369 let entries = typeProfile.entries;

Calls 9

locationMarkFunction · 0.85
getScriptWithSourceMethod · 0.80
sortMethod · 0.80
sliceMethod · 0.65
filterMethod · 0.65
splitMethod · 0.45
indexOfMethod · 0.45
logMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected