Make very simple shallow copy of aceDelta when there's an undo error

This commit is contained in:
James Allen 2016-10-31 16:47:13 +00:00
parent 4721fd450c
commit 26410690da

View file

@ -233,16 +233,11 @@ define [
start = aceDelta.start
if !start?
error = new Error("aceDelta had no start event.")
JSONstringifyWithCycles = (o) ->
seen = []
return JSON.stringify o, (k,v) ->
if (typeof v == 'object')
if ( !seen.indexOf(v) )
return '__cycle__'
seen.push(v);
return v
inspectedAceDelta = {}
for key, value of aceDelta
inspectedAceDelta[key] = typeof value
Raven?.captureException(error, {
aceDelta: JSONstringifyWithCycles(aceDelta)
aceDelta: JSON.stringify(inspectedAceDelta)
})
throw error
linesBefore = docLines.slice(0, start.row)