Don't throw errors in older versions of node/V8 that don't support the Set object. (#485)

Fixes #484.
This commit is contained in:
Justin McConnell 2017-03-03 13:33:40 -08:00 committed by Trent Mick
parent 4b9df6631f
commit 55f8c9d172

View file

@ -1197,7 +1197,7 @@ function safeCyclesArray() {
* Choose the best safe cycle function from what is available - see * Choose the best safe cycle function from what is available - see
* trentm/node-bunyan#445. * trentm/node-bunyan#445.
*/ */
var safeCycles = Set ? safeCyclesSet : safeCyclesArray; var safeCycles = typeof Set !== 'undefined' ? safeCyclesSet : safeCyclesArray;
/** /**
* A fast JSON.stringify that handles cycles and getter exceptions (when * A fast JSON.stringify that handles cycles and getter exceptions (when