mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Make very simple shallow copy of aceDelta when there's an undo error
This commit is contained in:
parent
4721fd450c
commit
26410690da
1 changed files with 4 additions and 9 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue