process.env is undefined by aylanbrown · Pull Request #723 · debug-js/debug

@aylanbrown

@aylanbrown

@coveralls

Coverage Status

Coverage remained the same at 87.692% when pulling 60e443b on aylanbrown:master into 5c7c61d on visionmedia:master.

Qix-

// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
// process.env is undefined in sometimes, and it will throw a exception
if (!r && typeof process !== 'undefined' && 'env' in process && process.env !== undefined) {

Choose a reason for hiding this comment

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

The second two checks can be simplified as just process.env.

Choose a reason for hiding this comment

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

Ok, I changed it

@aylanbrown

@Qix-

Can you squash please? :)

@aylanbrown

Can you squash please? :)

I built my project by webpack, and browser throw 'production is not undefined'. Check only process.env is undefined is useless, I use try {} catch(e){} to resolve it

@aylanbrown

@Qix-

Huh? I mean squash your commits with git.

@xamgore

@Qix-

@xamgore I'm very aware. I was not near a computer at the time and the mobile client does not have the feature.