mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue