       result = fn()
     catch exception
       @revertToCheckpoint(checkpoint)
-      throw exception unless exception is TransactionAborted
+      throw exception unless exception instanceof TransactionAbortedError
       return
     finally
       @transactCallDepth--

    result

  abortTransaction: ->
    throw TransactionAborted

  # Public: Clear the undo stack.
  clearUndoStack: -> @history.clearUndoStack()

MarkerStore = require "./marker-store"
{spliceArray, newlineRegex} = require './helpers'

class TransactionAbortedError extends Error
  constructor: -> super

# Extended: A mutable text container with undo/redo support and the ability to
# annotate logical regions in the text.
