function checkWasAssigned(alias,scope){var variable=scope.set.get(alias);if(!variable){return;}if(variable.defs.some(function(def){return def.node.type==="VariableDeclarator"&&def.node.init!==null;})){return;}// The alias has been declared and not assigned: check it was
// assigned later in the same scope.
if(!variable.references.some(function(reference){var write=reference.writeExpr;return reference.from===scope&&write&&write.type==="ThisExpression"&&write.parent.operator==="=";})){variable.defs.map(function(def){return def.node;}).forEach(function(node){reportBadAssignment(node,alias);});}}
Ensures that a variable declaration of the alias in a program or function
is assigned to the correct value.
@param {string} alias alias the check the assignment of.
@param {Object} scope scope of the current code we are checking.
@private
@returns {void}