Skip to content

Conversation

@DonutEspresso
Copy link
Member

@yunong @micahr was a bit optimistic in prior commit. have to push out a patch now. ;( can you guys verify this logic? this was blowing up in the case the value is undefined, where any property accesses (typeof or hasOwnProperty) will instantly fail.

@micahr
Copy link
Contributor

micahr commented Feb 9, 2016

This seems fine. But so did the last one. 😄

@DonutEspresso
Copy link
Member Author

I added another scenario - usage of JSON.stringify if it's a POJO.

@DonutEspresso DonutEspresso force-pushed the fix-serializer branch 4 times, most recently from c63da38 to 445ab29 Compare February 17, 2016 22:04
@DonutEspresso
Copy link
Member Author

Direction of the PR changed. We now use JSON.stringify, and fall back on safe-json-stringify if we can't handle the circular refs. This is the strategy that bunyan currently uses.

DonutEspresso added a commit that referenced this pull request Feb 17, 2016
fix corner cases where val cannot be serialized
@DonutEspresso DonutEspresso merged commit 67a11cb into master Feb 17, 2016
@DonutEspresso DonutEspresso deleted the fix-serializer branch February 17, 2016 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants