add missing semicolon; less expensive Ox.print, with updated documentation; make sure Ox.uid never returns falsy ids

This commit is contained in:
rolux 2013-11-29 21:11:36 +01:00
parent 420dd7f266
commit 3ad31125b3

View file

@ -44,7 +44,7 @@ Ox.load = function() {
if (Ox.isString(value)) {
modules[value] = {};
} else {
Ox.extend(modules, value)
Ox.extend(modules, value);
}
});
} else if (type == 'object') {
@ -233,13 +233,13 @@ Ox.print <f> Prints its arguments to the console
The string contains the timestamp, the name of the caller function, and
any arguments, separated by spaces
arg <*> any value
> Ox.print('foo').split(' ').pop()
"foo"
> Ox.print('foo', 'bar').split(' ').slice(1).join(' ')
'foo bar'
@*/
Ox.print = function() {
var args = Ox.toArray(arguments), date = new Date();
var args = Ox.slice(arguments), date = new Date();
args.unshift(
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().slice(-3)
date.toString().split(' ')[4] + '.' + (+date).toString().slice(-3)
);
window.console && window.console.log.apply(window.console, args);
return args.join(' ');
@ -254,7 +254,7 @@ Ox.uid <f> Returns a unique id
Ox.uid = (function() {
var uid = 0;
return function() {
return uid++;
return ++uid;
};
}());