Skip to content

Commit

Permalink
Added support for WinJS stack traces
Browse files Browse the repository at this point in the history
Issue #14 (changes from raygun)
  • Loading branch information
niemyjski committed May 16, 2015
1 parent 1806c98 commit 24eb0d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {

var chrome = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i,
winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
lines = ex.stack.split('\n'),
stack = [],
parts,
Expand All @@ -651,6 +652,13 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
'line': +parts[3],
'column': parts[4] ? +parts[4] : null
};
} else if ((parts = winjs.exec(lines[i]))) {
element = {
'url': parts[2],
'func': parts[1] || UNKNOWN_FUNCTION,
'line': +parts[3],
'column': parts[4] ? +parts[4] : null
};
} else {
continue;
}
Expand Down

0 comments on commit 24eb0d2

Please sign in to comment.