Skip to content

Commit

Permalink
Adjust regex pattern for match file names in Gecko-style traces
Browse files Browse the repository at this point in the history
The pattern for Gecko-style traces can match both URLs that start with a protocol and also local file paths when running scripts in JavaScriptCore. Allow files to start with any non-space character which covers periods, hyphens, and underscores for example.
  • Loading branch information
ide committed Jun 30, 2015
1 parent 49c879d commit ba97698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stacktrace-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var StackTraceParser = {
*/
parse: function(stackString) {
var chrome = /^\s*at (?:(?:(?:Anonymous function)?|((?:\[object object\])?\S+(?: \[as \S+\])?)) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^(?:\s*(\S*)(?:\((.*?)\))?@)?((?:\w).*?):(\d+)(?::(\d+))?\s*$/i,
gecko = /^(?:\s*(\S*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i,
node = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i,
lines = stackString.split('\n'),
stack = [],
Expand Down

0 comments on commit ba97698

Please sign in to comment.