diff options
author | Mathias Rangel Wulff <m@rawu.dk> | 2016-09-12 11:38:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-12 11:38:08 +0300 |
commit | 2e361bec971ea233813b3631e067da981f611e79 (patch) | |
tree | 0f55a11d91f15c8f1ef12db9546bec420a44aff6 | |
parent | 9bf0998e553465de62d7026b51681cc742290df6 (diff) |
Correct check for undefined variable
The code was comparing the result of `typeof` with a variable named `undefined`.
As typeof returns a string it should compare to `'undefined'`.
-rw-r--r-- | src/core.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core.js b/src/core.js index c40d29b..98d7a4d 100644 --- a/src/core.js +++ b/src/core.js @@ -162,7 +162,7 @@ Candy.Core = (function(self, Strophe, $) { // Enable debug logging if(_options.debug) { - if(typeof window.console !== undefined && typeof window.console.log !== undefined) { + if(typeof window.console !== 'undefined' && typeof window.console.log !== 'undefined') { // Strophe has a polyfill for bind which doesn't work in IE8. if(Function.prototype.bind && Candy.Util.getIeVersion() > 8) { self.log = Function.prototype.bind.call(console.log, console); |