From 55f8c9d17211104a860082b44639f4e59f2fa9bd Mon Sep 17 00:00:00 2001 From: Justin McConnell Date: Fri, 3 Mar 2017 13:33:40 -0800 Subject: [PATCH] Don't throw errors in older versions of node/V8 that don't support the Set object. (#485) Fixes #484. --- lib/bunyan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bunyan.js b/lib/bunyan.js index 6ed9e8a..7dfc385 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -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