I think there's two bugs here. It looks like death is being triggered which causing a crash. So I fixed that, but death should not be triggered there at all. Which browser are you using? I can't reproduce it on Chrome.
Firefox. Which seemed to be working otherwise? (Though I admit I didn't play for very long--not the fault of the game, which looks clever, but of my inability to think in isometric coordinates.)