Skip to content

Conversation

@leedm777
Copy link
Contributor

@leedm777 leedm777 commented Jun 6, 2014

On Node.js, if you set a process.env field to either null or undefined,
it gets cast to string 'null' or 'undefined'.

For debug, this means that if you don't have DEBUG set, it will get set
to the string 'undefined'. There are other modules (like
node-rest-client) which use the DEBUG environment variable that will
start spewing debug output when you don't want it to.

node.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do if (null == namespaces) (double equals instead of triple). It means the same thing.

@TooTallNate
Copy link
Contributor

Good catch! A few nits but once those are fixed I'll merge.

@leedm777
Copy link
Contributor Author

leedm777 commented Jun 6, 2014

Nits fixed. Thanks!

@TooTallNate
Copy link
Contributor

While you're at it, can you do the same kind of fix in browser.js as well?

On Node.js, if you set a process.env field to either null or undefined,
it gets cast to string 'null' or 'undefined'.

For debug, this means that if you don't have DEBUG set, it will get set
to the string 'undefined'. There are other modules (like
node-rest-client) which use the DEBUG environment variable that will
start spewing debug output when you don't want it to.
@leedm777
Copy link
Contributor Author

leedm777 commented Jun 6, 2014

Done.

@TooTallNate
Copy link
Contributor

Sweet. Thanks!

TooTallNate added a commit that referenced this pull request Jun 6, 2014
Don't set DEBUG if namespaces is undefined.
@TooTallNate TooTallNate merged commit 462c3b2 into debug-js:master Jun 6, 2014
@leedm777 leedm777 deleted the fix-debug-env branch June 6, 2014 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants