From c3b8dd26a7fc8b32e6fb4ff42970933bb2c749ed Mon Sep 17 00:00:00 2001 From: Ryan Graham Date: Fri, 8 Aug 2014 18:17:37 -0700 Subject: [PATCH] Fix parent instanceof guard The ! operator is higher priority than the instanceof operator, so the expression (! this instanceof X) is the same as ((!this) instanceof X), which will always evaluate to false. --- lib/bunyan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bunyan.js b/lib/bunyan.js index 9e93d76..ea4d02f 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -242,7 +242,7 @@ function Logger(options, _childOptions, _childSimple) { if (_childOptions !== undefined) { parent = options; options = _childOptions; - if (! parent instanceof Logger) { + if (!(parent instanceof Logger)) { throw new TypeError( 'invalid Logger creation: do not pass a second arg'); }