Fix JS backtrace parsing since PhantomJS 2.x (#177)

Fixes #177.
This commit is contained in:
Gaël Métais
2016-07-10 10:24:51 +08:00
committed by GitHub
parent 3d377b7b1f
commit 5ccab1770b
3 changed files with 80 additions and 10 deletions
+14 -6
View File
@@ -641,6 +641,11 @@
withFnResult = /^([^\s\(]+) \((.+:\d+:\d+)\)$/.exec(trace);
}
if (withFnResult === null) {
// Yet another PhantomJS 2 format?
withFnResult = /^([^\s\(]+|global code)@(.+:\d+:\d+)$/.exec(trace);
}
if (withFnResult === null) {
// Try the PhantomJS 2 ERROR format
withFnResult = /^([^\s\(]+) (http.+:\d+)$/.exec(trace);
@@ -664,12 +669,15 @@
var line = fileAndLineSplit[2];
var column = fileAndLineSplit[3];
out.push({
fnName: fnName,
filePath: filePath,
line: line,
column: column
});
// Filter phantomas code
if (filePath.indexOf('phantomjs://') === -1) {
out.push({
fnName: fnName,
filePath: filePath,
line: line,
column: column
});
}
});
} catch(e) {