Skip to content

Commit

Permalink
Merge pull request #1 from frantic/jsc
Browse files Browse the repository at this point in the history
Add support for JavaScriptCore
  • Loading branch information
Calamari committed Jun 25, 2015
2 parents 6737038 + 493c5e5 commit 49c879d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions 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*)(?:\((.*?)\))?@)?((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i,
gecko = /^(?:\s*(\S*)(?:\((.*?)\))?@)?((?:\w).*?):(\d+)(?::(\d+))?\s*$/i,
node = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i,
lines = stackString.split('\n'),
stack = [],
Expand Down
24 changes: 24 additions & 0 deletions test/stacktrace_parser_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,30 @@ describe('StackTraceParser', function() {
column: 580 } ]
}
],
'JavaScriptCore': [
{
from: "timeoutWithName@stack_traces/test:83:55\nwrapped@bandage.js:51:30",
to: [ { file: 'stack_traces/test',
methodName: 'timeoutWithName',
lineNumber: 83,
column: 55 },
{ file: 'bandage.js',
methodName: 'wrapped',
lineNumber: 51,
column: 30 } ]
},
{
from: "timeoutWithName@stack_traces/test:83:55\nwrapped@42start-with-number.js:51:30",
to: [ { file: 'stack_traces/test',
methodName: 'timeoutWithName',
lineNumber: 83,
column: 55 },
{ file: '42start-with-number.js',
methodName: 'wrapped',
lineNumber: 51,
column: 30 } ]
}
],
'Internet Explorer': [
{
from: "Error: with timeout and named func\n at timeoutWithName (http://bandage.jaz-lounge.com/stack_traces/test:83:9)\n at wrapped (http://bandage.jaz-lounge.com/bandage.js:51:13)",
Expand Down

0 comments on commit 49c879d

Please sign in to comment.