function isModifyingProp(reference){var node=reference.identifier;var parent=node.parent;while(parent&&!stopNodePattern.test(parent.type)){switch(parent.type){// e.g. foo.a = 0;
case"AssignmentExpression":return parent.left===node;// e.g. ++foo.a;
case"UpdateExpression":return true;// e.g. delete foo.a;
case"UnaryExpression":if(parent.operator==="delete"){return true;}break;// EXCLUDES: e.g. cache.get(foo.a).b = 0;
case"CallExpression":if(parent.callee!==node){return false;}break;// EXCLUDES: e.g. cache[foo.a] = 0;
case"MemberExpression":if(parent.property===node){return false;}break;// EXCLUDES: e.g. ({ [foo]: a }) = bar;
case"Property":if(parent.key===node){return false;}break;// no default
}node=parent;parent=node.parent;}return false;}
Checks whether or not the reference modifies properties of its variable.
@param {Reference} reference - A reference to check.
@returns {boolean} Whether or not the reference modifies properties of its variable.