From the forum:
while (enemy=this.findNearestEnemy()) this.attack(enemy);
... gives a message like, "Fix Your Code: expected a conditional expression and instead saw an assignment". However, this workaround works:
while ((enemy=this.findNearestEnemy())) this.attack(enemy);
Haven't yet looked to see where in the process the assignment is being broken.