fix line number for runtime errors

This commit is contained in:
Cassie Tarakajian 2017-08-01 15:03:48 -04:00
parent fa98306b9a
commit e111d3c020

View file

@ -34,8 +34,8 @@ function getAllScriptOffsets(htmlFile) {
} else {
endFilenameInd = htmlFile.indexOf('.js', ind + startTag.length + 3);
filename = htmlFile.substring(ind + startTag.length, endFilenameInd);
// the length of hijackConsoleErrorsScript is 35 lines, already needed a -1 offset.
lineOffset = htmlFile.substring(0, ind).split('\n').length + 34;
// the length of hijackConsoleErrorsScript is 31 lines
lineOffset = htmlFile.substring(0, ind).split('\n').length + 31;
offs.push([lineOffset, filename]);
lastInd = ind + 1;
}