Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.client.Debugger.getScriptSource({ scriptId: frame.location.scriptId }, function(err, resp) {
self.writeLn('break in ' + [lineNumber, columnNumber].join(':'))
var startLine = lineNumber - NUM_LINES;
var lastLine = lineNumber + NUM_LINES;
var out = [];
var src = cardinal.highlight(resp.scriptSource, {
theme: resolveCardinalTheme()
}).split('\n');
for (var i=startLine; i < lastLine; ++i) {
var prefix = pad(lastLine, lineNumber, i);
var bpsForLine = self.breakpointsForLocation({
scriptId: frame.location.scriptId,
lineNumber: i
});
if (bpsForLine) {
prefix = prefix.red;
}
if (src[i])
out.push(prefix + src[i]);
}
self.writeLn(out.join('\n'));
// TODO mark current column with underline?