function getRhsNode(ref,prevRhsNode){var id=ref.identifier;var parent=id.parent;var granpa=parent.parent;var refScope=ref.from.variableScope;var varScope=ref.resolved.scope.variableScope;var canBeUsedLater=refScope!==varScope||astUtils.isInLoop(id);/*
             * Inherits the previous node if this reference is in the node.
             * This is for `a = a + a`-like code.
             */if(prevRhsNode&&isInside(id,prevRhsNode)){return prevRhsNode;}if(parent.type==="AssignmentExpression"&&granpa.type==="ExpressionStatement"&&id===parent.left&&!canBeUsedLater){return parent.right;}return null;}
If a given reference is left-hand side of an assignment, this gets
the right-hand side node of the assignment.

In the following cases, this returns null.

- The reference is not the LHS of an assignment expression.
- The reference is inside of a loop.
- The reference is inside of a function scope which is different from
  the declaration.

@param {escope.Reference} ref - A reference to check.
@param {ASTNode} prevRhsNode - The previous RHS node.
@returns {ASTNode|null} The RHS node or null.
@private