Fix detection of multiple files, show more than one line in the bugpath only if neccessary
@@ -523,12 +523,10 @@ function (declare, dom, style, on, query, Memory, Observable, topic, entities,
var contains = function(substr) {
return msg.indexOf(substr) !== -1;
};
-
var extractFuncName = function(prefix) {
if (contains(prefix)) {
return msg.replace(prefix, "").replace("'", "");
}
-
return false;
};
@@ -604,15 +602,20 @@ function (declare, dom, style, on, query, Memory, Observable, topic, entities,
// Check if there are multiple files (XTU?) affected by this bug.
// If so, we show the file names properly.
reportDetails.pathEvents.some(function (step) {
- if (filePaths.indexOf(step.filePath) > -1) {
+ if (filePaths.indexOf(step.filePath) === -1) {
+ // File is not yet in the array, put it in.
+ filePaths.push(step.filePath);
+ } else {
+ if (filePaths.length !== 1) {
areThereMultipleFiles = true;
- return true; // Break execution of this foreach.
+ return true; // Break execution, multiple files were found
+ }
}
- filePaths.push(step.filePath);
- return false;
+ return false; // Continue checking
});
+ if (reportDetails.pathEvents.length > 1) {
reportDetails.pathEvents.forEach(function (step, index) {
var name;
var highlightData = that._highlightStep(highlightStack, step);
@@ -644,6 +647,7 @@ function (declare, dom, style, on, query, Memory, Observable, topic, entities,
report : report
});
});
+ }
});
},
