function isReadForItself(ref,rhsNode){var id=ref.identifier;var parent=id.parent;var granpa=parent.parent;return ref.isRead()&&(// self update. e.g. `a += 1`, `a++`
parent.type==="AssignmentExpression"&&granpa.type==="ExpressionStatement"&&parent.left===id||parent.type==="UpdateExpression"&&granpa.type==="ExpressionStatement"||// in RHS of an assignment for itself. e.g. `a = a + 1`
rhsNode&&isInside(id,rhsNode)&&!isInsideOfStorableFunction(id,rhsNode));}
Checks whether a given reference is a read to update itself or not.

@param {escope.Reference} ref - A reference to check.
@param {ASTNode} rhsNode - The RHS node of the previous assignment.
@returns {boolean} The reference is a read to update itself.
@private