From 58df808325289fc931c39b3d9d5130690884bd26 Mon Sep 17 00:00:00 2001 From: Ryan Graham Date: Fri, 8 Aug 2014 18:15:55 -0700 Subject: [PATCH] Fix ctor 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 cb7c298..9e93d76 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -233,7 +233,7 @@ function resolveLevel(nameOrNum) { */ function Logger(options, _childOptions, _childSimple) { xxx('Logger start:', options) - if (! this instanceof Logger) { + if (!(this instanceof Logger)) { return new Logger(options, _childOptions); }