function (s, o, g) {
        var a, i, k;
        JSHINT.errors = [];
        JSHINT.undefs = [];
        predefined = Object.create(standard);
        combine(predefined, g || {});
        if (o) {
            a = o.predef;
            if (a) {
                if (Array.isArray(a)) {
                    for (i = 0; i < a.length; i += 1) {
                        predefined[a[i]] = true;
                    }
                } else if (typeof a === 'object') {
                    k = Object.keys(a);
                    for (i = 0; i < k.length; i += 1) {
                        predefined[k[i]] = !!a[k[i]];
                    }
                }
            }
            option = o;
        } else {
            option = {};
        }
        option.indent = option.indent || 4;
        option.maxerr = option.maxerr || 50;

        tab = '';
        for (i = 0; i < option.indent; i += 1) {
            tab += ' ';
        }
        indent = 1;
        global = Object.create(predefined);
        scope = global;
        funct = {
            '(global)': true,
            '(name)': '(global)',
            '(scope)': scope,
            '(breakage)': 0,
            '(loopage)': 0
        };
        functions = [funct];
        urls = [];
        stack = null;
        member = {};
        membersOnly = null;
        implied = {};
        inblock = false;
        lookahead = [];
        jsonmode = false;
        warnings = 0;
        lex.init(s);
        prereg = true;
        directive = {};

        prevtoken = token = nexttoken = syntax['(begin)'];

        // Check options
        for (var name in o) {
            if (is_own(o, name)) {
                checkOption(name, token);
            }
        }

        assume();

        // combine the passed globals after we've assumed all our options
        combine(predefined, g || {});

        //reset values
        comma.first = true;

        try {
            advance();
            switch (nexttoken.id) {
            case '{':
            case '[':
                option.laxbreak = true;
                jsonmode = true;
                jsonValue();
                break;
            default:
                directives();
                if (directive["use strict"] && !option.globalstrict) {
                    warning("Use the function form of \"use strict\".", prevtoken);
                }

                statements();
            }
            advance('(end)');

            var markDefined = function (name, context) {
                do {
                    if (typeof context[name] === 'string') {
                        // JSHINT marks unused variables as 'unused' and
                        // unused function declaration as 'unction'. This
                        // code changes such instances back 'var' and
                        // 'closure' so that the code in JSHINT.data()
                        // doesn't think they're unused.

                        if (context[name] === 'unused')
                            context[name] = 'var';
                        else if (context[name] === 'unction')
                            context[name] = 'closure';

                        return true;
                    }

                    context = context['(context)'];
                } while (context);

                return false;
            };

            var clearImplied = function (name, line) {
                if (!implied[name])
                    return;

                var newImplied = [];
                for (var i = 0; i < implied[name].length; i += 1) {
                    if (implied[name][i] !== line)
                        newImplied.push(implied[name][i]);
                }

                if (newImplied.length === 0)
                    delete implied[name];
                else
                    implied[name] = newImplied;
            };

            // Check queued 'x is not defined' instances to see if they're still undefined.
            for (i = 0; i < JSHINT.undefs.length; i += 1) {
                k = JSHINT.undefs[i].slice(0);

                if (markDefined(k[2].value, k[0])) {
                    clearImplied(k[2].value, k[2].line);
                } else {
                    warning.apply(warning, k.slice(1));
                }
            }
        } catch (e) {
            if (e) {
                var nt = nexttoken || {};
                JSHINT.errors.push({
                    raw       : e.raw,
                    reason    : e.message,
                    line      : e.line || nt.line,
                    character : e.character || nt.from
                }, null);
            }
        }

        return JSHINT.errors.length === 0;
    }
function (s, o, g) {
        var a, i, k;
        JSHINT.errors = [];
        JSHINT.undefs = [];
        predefined = Object.create(standard);
        combine(predefined, g || {});
        if (o) {
            a = o.predef;
            if (a) {
                if (Array.isArray(a)) {
                    for (i = 0; i < a.length; i += 1) {
                        predefined[a[i]] = true;
                    }
                } else if (typeof a === 'object') {
                    k = Object.keys(a);
                    for (i = 0; i < k.length; i += 1) {
                        predefined[k[i]] = !!a[k[i]];
                    }
                }
            }
            option = o;
        } else {
            option = {};
        }
        option.indent = option.indent || 4;
        option.maxerr = option.maxerr || 50;

        tab = '';
        for (i = 0; i < option.indent; i += 1) {
            tab += ' ';
        }
        indent = 1;
        global = Object.create(predefined);
        scope = global;
        funct = {
            '(global)': true,
            '(name)': '(global)',
            '(scope)': scope,
            '(breakage)': 0,
            '(loopage)': 0
        };
        functions = [funct];
        urls = [];
        stack = null;
        member = {};
        membersOnly = null;
        implied = {};
        inblock = false;
        lookahead = [];
        jsonmode = false;
        warnings = 0;
        lex.init(s);
        prereg = true;
        directive = {};

        prevtoken = token = nexttoken = syntax['(begin)'];

        
        for (var name in o) {
            if (is_own(o, name)) {
                checkOption(name, token);
            }
        }

        assume();

        
        combine(predefined, g || {});

        
        comma.first = true;

        try {
            advance();
            switch (nexttoken.id) {
            case '{':
            case '[':
                option.laxbreak = true;
                jsonmode = true;
                jsonValue();
                break;
            default:
                directives();
                if (directive["use strict"] && !option.globalstrict) {
                    warning("Use the function form of \"use strict\".", prevtoken);
                }

                statements();
            }
            advance('(end)');

            var markDefined = function (name, context) {
                do {
                    if (typeof context[name] === 'string') {
                        
                        
                        
                        
                        

                        if (context[name] === 'unused')
                            context[name] = 'var';
                        else if (context[name] === 'unction')
                            context[name] = 'closure';

                        return true;
                    }

                    context = context['(context)'];
                } while (context);

                return false;
            };

            var clearImplied = function (name, line) {
                if (!implied[name])
                    return;

                var newImplied = [];
                for (var i = 0; i < implied[name].length; i += 1) {
                    if (implied[name][i] !== line)
                        newImplied.push(implied[name][i]);
                }

                if (newImplied.length === 0)
                    delete implied[name];
                else
                    implied[name] = newImplied;
            };

            
            for (i = 0; i < JSHINT.undefs.length; i += 1) {
                k = JSHINT.undefs[i].slice(0);

                if (markDefined(k[2].value, k[0])) {
                    clearImplied(k[2].value, k[2].line);
                } else {
                    warning.apply(warning, k.slice(1));
                }
            }
        } catch (e) {
            if (e) {
                var nt = nexttoken || {};
                JSHINT.errors.push({
                    raw       : e.raw,
                    reason    : e.message,
                    line      : e.line || nt.line,
                    character : e.character || nt.from
                }, null);
            }
        }

        return JSHINT.errors.length === 0;
    }
function ( s , o , g ) { var a , i , k ; JSHINT . errors = [ ] ; JSHINT . undefs = [ ] ; predefined = Object . create ( standard ) ; combine ( predefined , g || { } ) ; if ( o ) { a = o . predef ; if ( a ) { if ( Array . isArray ( a ) ) { for ( i = 0 ; i < a . length ; i += 1 ) { predefined [ a [ i ] ] = true ; } } else if ( typeof a === 'object' ) { k = Object . keys ( a ) ; for ( i = 0 ; i < k . length ; i += 1 ) { predefined [ k [ i ] ] = ! ! a [ k [ i ] ] ; } } } option = o ; } else { option = { } ; } option . indent = option . indent || 4 ; option . maxerr = option . maxerr || 50 ; tab = '' ; for ( i = 0 ; i < option . indent ; i += 1 ) { tab += ' ' ; } indent = 1 ; global = Object . create ( predefined ) ; scope = global ; funct = { '(global)' : true , '(name)' : '(global)' , '(scope)' : scope , '(breakage)' : 0 , '(loopage)' : 0 } ; functions = [ funct ] ; urls = [ ] ; stack = null ; member = { } ; membersOnly = null ; implied = { } ; inblock = false ; lookahead = [ ] ; jsonmode = false ; warnings = 0 ; lex . init ( s ) ; prereg = true ; directive = { } ; prevtoken = token = nexttoken = syntax [ '(begin)' ] ; // Check options for ( var name in o ) { if ( is_own ( o , name ) ) { checkOption ( name , token ) ; } } assume ( ) ; // combine the passed globals after we've assumed all our options combine ( predefined , g || { } ) ; //reset values comma . first = true ; try { advance ( ) ; switch ( nexttoken . id ) { case '{' : case '[' : option . laxbreak = true ; jsonmode = true ; jsonValue ( ) ; break ; default : directives ( ) ; if ( directive [ "use strict" ] && ! option . globalstrict ) { warning ( "Use the function form of \"use strict\"." , prevtoken ) ; } statements ( ) ; } advance ( '(end)' ) ; var markDefined = function ( name , context ) { do { if ( typeof context [ name ] === 'string' ) { // JSHINT marks unused variables as 'unused' and // unused function declaration as 'unction'. This // code changes such instances back 'var' and // 'closure' so that the code in JSHINT.data() // doesn't think they're unused. if ( context [ name ] === 'unused' ) context [ name ] = 'var' ; else if ( context [ name ] === 'unction' ) context [ name ] = 'closure' ; return true ; } context = context [ '(context)' ] ; } while ( context ) ; return false ; } ; var clearImplied = function ( name , line ) { if ( ! implied [ name ] ) return ; var newImplied = [ ] ; for ( var i = 0 ; i < implied [ name ] . length ; i += 1 ) { if ( implied [ name ] [ i ] !== line ) newImplied . push ( implied [ name ] [ i ] ) ; } if ( newImplied . length === 0 ) delete implied [ name ] ; else implied [ name ] = newImplied ; } ; // Check queued 'x is not defined' instances to see if they're still undefined. for ( i = 0 ; i < JSHINT . undefs . length ; i += 1 ) { k = JSHINT . undefs [ i ] . slice ( 0 ) ; if ( markDefined ( k [ 2 ] . value , k [ 0 ] ) ) { clearImplied ( k [ 2 ] . value , k [ 2 ] . line ) ; } else { warning . apply ( warning , k . slice ( 1 ) ) ; } } } catch ( e ) { if ( e ) { var nt = nexttoken || { } ; JSHINT . errors . push ( { raw : e . raw , reason : e . message , line : e . line || nt . line , character : e . character || nt . from } , null ) ; } } return JSHINT . errors . length === 0 ; }
The actual JSHINT function itself.
The actual JSHINT function itself .