release/rollbar-1.2.0.commonjs.js
function computeStackTraceFromStacktraceProp(ex) {
        // Access and store the stacktrace property before doing ANYTHING
        // else to it because Opera is not very good at providing it
        // reliably in other circumstances.
        var stacktrace = ex.stacktrace;

        var testRE = / line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,
            lines = stacktrace.split('\n'),
            stack = [],
            parts;

        for (var i = 0, j = lines.length; i < j; i += 2) {
            if ((parts = testRE.exec(lines[i]))) {
                var element = {
                    'line': +parts[1],
                    'column': +parts[2],
                    'func': parts[3] || parts[4],
                    'args': parts[5] ? parts[5].split(',') : [],
                    'url': parts[6]
                };

                if (!element.func && element.line) {
                    element.func = guessFunctionName(element.url, element.line);
                }
                if (element.line) {
                    try {
                        element.context = gatherContext(element.url, element.line);
                    } catch (exc) {}
                }

                if (!element.context) {
                    element.context = [lines[i + 1]];
                }

                stack.push(element);
            }
        }

        if (!stack.length) {
            return null;
        }

        return {
            'mode': 'stacktrace',
            'name': ex.name,
            'message': ex.message,
            'url': document.location.href,
            'stack': stack,
            'useragent': navigator.userAgent
        };
    }
function computeStackTraceFromStacktraceProp(ex) {
        // Access and store the stacktrace property before doing ANYTHING
        // else to it because Opera is not very good at providing it
        // reliably in other circumstances.
        var stacktrace = ex.stacktrace;

        var testRE = / line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,
            lines = stacktrace.split('\n'),
            stack = [],
            parts;

        for (var i = 0, j = lines.length; i < j; i += 2) {
            if ((parts = testRE.exec(lines[i]))) {
                var element = {
                    'line': +parts[1],
                    'column': +parts[2],
                    'func': parts[3] || parts[4],
                    'args': parts[5] ? parts[5].split(',') : [],
                    'url': parts[6]
                };

                if (!element.func && element.line) {
                    element.func = guessFunctionName(element.url, element.line);
                }
                if (element.line) {
                    try {
                        element.context = gatherContext(element.url, element.line);
                    } catch (exc) {}
                }

                if (!element.context) {
                    element.context = [lines[i + 1]];
                }

                stack.push(element);
            }
        }

        if (!stack.length) {
            return null;
        }

        return {
            'mode': 'stacktrace',
            'name': ex.name,
            'message': ex.message,
            'url': document.location.href,
            'stack': stack,
            'useragent': navigator.userAgent
        };
    }
function computeStackTraceFromStacktraceProp ( ex ) { // Access and store the stacktrace property before doing ANYTHING // else to it because Opera is not very good at providing it // reliably in other circumstances. var stacktrace = ex . stacktrace ; var testRE = /  line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$ / i , lines = stacktrace . split ( '\n' ) , stack = [ ] , parts ; for ( var i = 0 , j = lines . length ; i < j ; i += 2 ) { if ( ( parts = testRE . exec ( lines [ i ] ) ) ) { var element = { 'line' : + parts [ 1 ] , 'column' : + parts [ 2 ] , 'func' : parts [ 3 ] || parts [ 4 ] , 'args' : parts [ 5 ] ? parts [ 5 ] . split ( ',' ) : [ ] , 'url' : parts [ 6 ] } ; if ( ! element . func && element . line ) { element . func = guessFunctionName ( element . url , element . line ) ; } if ( element . line ) { try { element . context = gatherContext ( element . url , element . line ) ; } catch ( exc ) { } } if ( ! element . context ) { element . context = [ lines [ i + 1 ] ] ; } stack . push ( element ) ; } } if ( ! stack . length ) { return null ; } return { 'mode' : 'stacktrace' , 'name' : ex . name , 'message' : ex . message , 'url' : document . location . href , 'stack' : stack , 'useragent' : navigator . userAgent } ; }
Computes stack trace information from the stacktrace property.
Opera 10 uses this property.
@param {Error} ex
@return {?Object.<string, *>} Stack trace information.
Computes stack trace information from the stacktrace property . Opera 10 uses this property .