assert is a little bit late, as a line before already recentEditOps.length > 0 is assumed. recentEditOps[-1] will return undefined, right? So possibly no real problem, just stumbled over this while reading.