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