function isUsedVariable(variable) {
            const functionNodes = getFunctionDefinitions(variable),
                isFunctionDefinition = functionNodes.length > 0;
            let rhsNode = null;

            return variable.references.some(ref => {
                if (isForInRef(ref)) {
                    return true;
                }

                const forItself = isReadForItself(ref, rhsNode);

                rhsNode = getRhsNode(ref, rhsNode);

                return (
                    isReadRef(ref) &&
                    !forItself &&
                    !(isFunctionDefinition && isSelfReference(ref, functionNodes))
                );
            });
        }
function isUsedVariable(variable) {
            const functionNodes = getFunctionDefinitions(variable),
                isFunctionDefinition = functionNodes.length > 0;
            let rhsNode = null;

            return variable.references.some(ref => {
                if (isForInRef(ref)) {
                    return true;
                }

                const forItself = isReadForItself(ref, rhsNode);

                rhsNode = getRhsNode(ref, rhsNode);

                return (
                    isReadRef(ref) &&
                    !forItself &&
                    !(isFunctionDefinition && isSelfReference(ref, functionNodes))
                );
            });
        }
function isUsedVariable ( variable ) { const functionNodes = getFunctionDefinitions ( variable ) , isFunctionDefinition = functionNodes . length > 0 ; let rhsNode = null ; return variable . references . some ( ref => { if ( isForInRef ( ref ) ) { return true ; } const forItself = isReadForItself ( ref , rhsNode ) ; rhsNode = getRhsNode ( ref , rhsNode ) ; return ( isReadRef ( ref ) && ! forItself && ! ( isFunctionDefinition && isSelfReference ( ref , functionNodes ) ) ) ; } ) ; }
Determines if the variable is used.
@param {Variable} variable - The variable to check.
@returns {boolean} True if the variable is used
@private
Determines if the variable is used .
returns true if variable is used