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.
This commit is contained in:
Ryan Graham 2014-08-08 18:17:37 -07:00
parent e4ea3fb05f
commit c3b8dd26a7

View file

@ -242,7 +242,7 @@ function Logger(options, _childOptions, _childSimple) {
if (_childOptions !== undefined) { if (_childOptions !== undefined) {
parent = options; parent = options;
options = _childOptions; options = _childOptions;
if (! parent instanceof Logger) { if (!(parent instanceof Logger)) {
throw new TypeError( throw new TypeError(
'invalid Logger creation: do not pass a second arg'); 'invalid Logger creation: do not pass a second arg');
} }