Serialize root view state to a string of JSON when storing it on the window upon refresh

This avoid situations where arrays in the window state pointed to a different constructor than the current context's Array constructor.
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-06-15 15:32:27 -06:00
parent 4a35427db3
commit 951f76f2bf
3 changed files with 3 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ describe "Window", ->
expect(atom.rootViewStates[$windowNumber]).toBeUndefined()
expectedState = window.rootView.serialize()
$(window).trigger 'beforeunload'
expect(atom.rootViewStates[$windowNumber]).toEqual expectedState
expect(atom.rootViewStates[$windowNumber]).toEqual JSON.stringify(expectedState)
it "unsubscribes from all buffers", ->
editor1 = rootView.activeEditor()