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

Fixes #484.
master
Justin McConnell 2017-03-03 13:33:40 -08:00 committed by Trent Mick
parent 4b9df6631f
commit 55f8c9d172
1 changed files with 1 additions and 1 deletions

View File

@ -1197,7 +1197,7 @@ function safeCyclesArray() {
* Choose the best safe cycle function from what is available - see
* 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