mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
dfc0910023
If the object passed via IPC contains any keys of the same reference, all but one of these keys will be nulled out. Converting to/from a string avoids this problem.
20 lines
729 B
JavaScript
20 lines
729 B
JavaScript
/** @babel */
|
|
|
|
import {it, fit, ffit, fffit, beforeEach, afterEach} from './async-spec-helpers'
|
|
import ApplicationDelegate from '../src/application-delegate'
|
|
|
|
describe('ApplicationDelegate', function () {
|
|
describe('set/getTemporaryWindowState', function () {
|
|
it('can serialize object trees containing redundant child object references', async function () {
|
|
const applicationDelegate = new ApplicationDelegate()
|
|
const childObject = {c: 1}
|
|
const sentObject = {a: childObject, b: childObject}
|
|
|
|
await applicationDelegate.setTemporaryWindowState(sentObject)
|
|
const receivedObject = await applicationDelegate.getTemporaryWindowState()
|
|
|
|
expect(receivedObject).toEqual(sentObject)
|
|
})
|
|
})
|
|
})
|