release/rollbar-1.2.0.commonjs.js
function guessFunctionName(url, lineNo) {
        var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/,
            reGuessFunction = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,
            line = '',
            maxLines = 10,
            source = getSource(url),
            m;

        if (!source.length) {
            return UNKNOWN_FUNCTION;
        }

        // Walk backwards from the first line in the function until we find the line which
        // matches the pattern above, which is the function definition
        for (var i = 0; i < maxLines; ++i) {
            line = source[lineNo - i] + line;

            if (!_isUndefined(line)) {
                if ((m = reGuessFunction.exec(line))) {
                    return m[1];
                } else if ((m = reFunctionArgNames.exec(line))) {
                    return m[1];
                }
            }
        }

        return UNKNOWN_FUNCTION;
    }
function guessFunctionName(url, lineNo) {
        var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/,
            reGuessFunction = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,
            line = '',
            maxLines = 10,
            source = getSource(url),
            m;

        if (!source.length) {
            return UNKNOWN_FUNCTION;
        }

        // Walk backwards from the first line in the function until we find the line which
        // matches the pattern above, which is the function definition
        for (var i = 0; i < maxLines; ++i) {
            line = source[lineNo - i] + line;

            if (!_isUndefined(line)) {
                if ((m = reGuessFunction.exec(line))) {
                    return m[1];
                } else if ((m = reFunctionArgNames.exec(line))) {
                    return m[1];
                }
            }
        }

        return UNKNOWN_FUNCTION;
    }
function guessFunctionName ( url , lineNo ) { var reFunctionArgNames = / function ([^(]*)\(([^)]*)\) / , reGuessFunction = / ['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function) / , line = '' , maxLines = 10 , source = getSource ( url ) , m ; if ( ! source . length ) { return UNKNOWN_FUNCTION ; } // Walk backwards from the first line in the function until we find the line which // matches the pattern above, which is the function definition for ( var i = 0 ; i < maxLines ; ++ i ) { line = source [ lineNo - i ] + line ; if ( ! _isUndefined ( line ) ) { if ( ( m = reGuessFunction . exec ( line ) ) ) { return m [ 1 ] ; } else if ( ( m = reFunctionArgNames . exec ( line ) ) ) { return m [ 1 ] ; } } } return UNKNOWN_FUNCTION ; }
Tries to use an externally loaded copy of source code to determine
the name of a function by looking at the name of the variable it was
assigned to, if any.
@param {string} url URL of source code.
@param {(string|number)} lineNo Line number in source code.
@return {string} The function name, if discoverable.
Tries to use an externally loaded copy of source code to determine the name of a function by looking at the name of the variable it was assigned to if any .