function groupByDestructuring(variables,ignoreReadBeforeAssign){var identifierMap=new _map4.default();for(var i=0;i<variables.length;++i){var variable=variables[i];var references=variable.references;var identifier=getIdentifierIfShouldBeConst(variable,ignoreReadBeforeAssign);var prevId=null;for(var j=0;j<references.length;++j){var reference=references[j];var id=reference.identifier;// Avoid counting a reference twice or more for default values of
// destructuring.
if(id===prevId){continue;}prevId=id;// Add the identifier node into the destructuring group.
var group=getDestructuringHost(reference);if(group){if(identifierMap.has(group)){identifierMap.get(group).push(identifier);}else{identifierMap.set(group,[identifier]);}}}}return identifierMap;}
Groups by the VariableDeclarator/AssignmentExpression node that each
reference of given variables belongs to.
This is used to detect a mix of reassigned and never reassigned in a
destructuring.

@param {escope.Variable[]} variables - Variables to group by destructuring.
@param {boolean} ignoreReadBeforeAssign -
     The value of `ignoreReadBeforeAssign` option.
@returns {Map<ASTNode, ASTNode[]>} Grouped identifier nodes.