From ba9769802c3538c1c2036bf50a28bd9c4ceced59 Mon Sep 17 00:00:00 2001 From: James Ide Date: Wed, 24 Jun 2015 13:52:11 -0700 Subject: [PATCH] Adjust regex pattern for match file names in Gecko-style traces 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. --- lib/stacktrace-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stacktrace-parser.js b/lib/stacktrace-parser.js index 1453f95..5a3fc7a 100644 --- a/lib/stacktrace-parser.js +++ b/lib/stacktrace-parser.js @@ -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 = [],