lib/rules/no-self-assign.js
function isSameMember(left, right) {
    if (!isSameProperty(left, right)) {
        return false;
    }

    const lobj = left.object;
    const robj = right.object;

    if (lobj.type !== robj.type) {
        return false;
    }
    if (lobj.type === "MemberExpression") {
        return isSameMember(lobj, robj);
    }
    return lobj.type === "Identifier" && lobj.name === robj.name;
}
function isSameMember(left, right) {
    if (!isSameProperty(left, right)) {
        return false;
    }

    const lobj = left.object;
    const robj = right.object;

    if (lobj.type !== robj.type) {
        return false;
    }
    if (lobj.type === "MemberExpression") {
        return isSameMember(lobj, robj);
    }
    return lobj.type === "Identifier" && lobj.name === robj.name;
}
function isSameMember ( left , right ) { if ( ! isSameProperty ( left , right ) ) { return false ; } const lobj = left . object ; const robj = right . object ; if ( lobj . type !== robj . type ) { return false ; } if ( lobj . type === "MemberExpression" ) { return isSameMember ( lobj , robj ) ; } return lobj . type === "Identifier" && lobj . name === robj . name ; }
Checks whether 2 given member expression nodes are the reference to the same
property or not.

@param {ASTNode} left - A member expression node to check.
@param {ASTNode} right - Another member expression node to check.
@returns {boolean} `true` if the member expressions are the reference to the
same property or not.
Checks whether 2 given member expression nodes are the reference to the same property or not .