lib/jslint.js
function enroll(name, role, readonly) {

// Enroll a name into the current function context. The role can be exception,
// function, label, parameter, or variable. We look for variable redefinition
// because it causes confusion.

        const id = name.id;

// Reserved words may not be enrolled.

        if (syntax[id] !== undefined && id !== "ignore") {
            warn("reserved_a", name);
        } else {

// Has the name been enrolled in this context?

            let earlier = functionage.context[id];
            if (earlier) {
                warn(
                    "redefinition_a_b",
                    name,
                    name.id,
                    earlier.line + fudge
                );

// Has the name been enrolled in an outer context?

            } else {
                stack.forEach(function (value) {
                    const item = value.context[id];
                    if (item !== undefined) {
                        earlier = item;
                    }
                });
                if (earlier) {
                    if (id === "ignore") {
                        if (earlier.role === "variable") {
                            warn("unexpected_a", name);
                        }
                    } else {
                        if (
                            (
                                role !== "exception"
                                || earlier.role !== "exception"
                            )
                            && role !== "parameter"
                            && role !== "function"
                        ) {
                            warn(
                                "redefinition_a_b",
                                name,
                                name.id,
                                earlier.line + fudge
                            );
                        }
                    }
                }

// Enroll it.

                functionage.context[id] = name;
                name.dead = true;
                name.function = functionage;
                name.init = false;
                name.role = role;
                name.used = 0;
                name.writable = !readonly;
            }
        }
    }
function enroll(name, role, readonly) {

// Enroll a name into the current function context. The role can be exception,
// function, label, parameter, or variable. We look for variable redefinition
// because it causes confusion.

        const id = name.id;

// Reserved words may not be enrolled.

        if (syntax[id] !== undefined && id !== "ignore") {
            warn("reserved_a", name);
        } else {

// Has the name been enrolled in this context?

            let earlier = functionage.context[id];
            if (earlier) {
                warn(
                    "redefinition_a_b",
                    name,
                    name.id,
                    earlier.line + fudge
                );

// Has the name been enrolled in an outer context?

            } else {
                stack.forEach(function (value) {
                    const item = value.context[id];
                    if (item !== undefined) {
                        earlier = item;
                    }
                });
                if (earlier) {
                    if (id === "ignore") {
                        if (earlier.role === "variable") {
                            warn("unexpected_a", name);
                        }
                    } else {
                        if (
                            (
                                role !== "exception"
                                || earlier.role !== "exception"
                            )
                            && role !== "parameter"
                            && role !== "function"
                        ) {
                            warn(
                                "redefinition_a_b",
                                name,
                                name.id,
                                earlier.line + fudge
                            );
                        }
                    }
                }

// Enroll it.

                functionage.context[id] = name;
                name.dead = true;
                name.function = functionage;
                name.init = false;
                name.role = role;
                name.used = 0;
                name.writable = !readonly;
            }
        }
    }
function enroll ( name , role , readonly ) { // Enroll a name into the current function context. The role can be exception, // function, label, parameter, or variable. We look for variable redefinition // because it causes confusion. const id = name . id ; // Reserved words may not be enrolled. if ( syntax [ id ] !== undefined && id !== "ignore" ) { warn ( "reserved_a" , name ) ; } else { // Has the name been enrolled in this context? let earlier = functionage . context [ id ] ; if ( earlier ) { warn ( "redefinition_a_b" , name , name . id , earlier . line + fudge ) ; // Has the name been enrolled in an outer context? } else { stack . forEach ( function ( value ) { const item = value . context [ id ] ; if ( item !== undefined ) { earlier = item ; } } ) ; if ( earlier ) { if ( id === "ignore" ) { if ( earlier . role === "variable" ) { warn ( "unexpected_a" , name ) ; } } else { if ( ( role !== "exception" || earlier . role !== "exception" ) && role !== "parameter" && role !== "function" ) { warn ( "redefinition_a_b" , name , name . id , earlier . line + fudge ) ; } } } // Enroll it. functionage . context [ id ] = name ; name . dead = true ; name . function = functionage ; name . init = false ; name . role = role ; name . used = 0 ; name . writable = ! readonly ; } } }
Now we parse JavaScript.
Now we parse JavaScript .