PR review feedback: The isDirty bit shoudn't be directly set. This is managed internally, and will be cleared when the document is saved or reverted.
Now calling doRevert instead of setting isDirty, JSLInt required to move doRevert up in the file, hence the move