Commit 021db091 authored by Leo Iannacone's avatar Leo Iannacone

fix arguments length - required at least 2 args

parent 3f9a6b68
...@@ -11,19 +11,16 @@ ...@@ -11,19 +11,16 @@
4 - socket received data 4 - socket received data
*/ */
var debug = function() { var debug = function() {
if (arguments.length == 0) { if (arguments.length < 2) {
return return
} }
var level = 1 var level = arguments[0]
if (arguments.length > 2) { arguments[0] = "debug [" + level + "]:"
level = arguments[0] if (level <= config.preferences.debug) {
arguments[0] = "debug [" + level + "]:" if (console.debug)
if (level <= config.preferences.debug) { console.debug.apply(console, arguments)
if (console.debug) else
console.debug.apply(console, arguments) console.log.apply(console, arguments)
else
console.log.apply(console, arguments)
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment