I'm using post-robot via zoid, passing an object back to my parent via a callback function. This object contains a circular reference deep within it, but I've implemented a toJSON() method on the class containing the reference in order to support serialization.
This object can be happily serialized with JSON.stringify(), but it breaks when post-robot serializes it. I believe post-robot isn't calling my toJSON() method, it's walking the object itself and follows the circular reference to its doom.
I'm using
post-robot
viazoid
, passing an object back to my parent via a callback function. This object contains a circular reference deep within it, but I've implemented atoJSON()
method on the class containing the reference in order to support serialization.This object can be happily serialized with JSON.stringify(), but it breaks when
post-robot
serializes it. I believepost-robot
isn't calling my toJSON() method, it's walking the object itself and follows the circular reference to its doom.Please advise?