rather use ''.slice than ''.substr

This commit is contained in:
rolux 2012-05-24 11:47:33 +02:00
commit 1608664bb6
20 changed files with 69 additions and 71 deletions

View file

@ -141,7 +141,7 @@ Ox.localStorage = function(namespace) {
ret = {};
Ox.forEach(localStorage, function(val, key) {
if (Ox.startsWith(key, namespace + '.')) {
ret[key.substr(namespace.length + 1)] = JSON.parse(val);
ret[key.slice(namespace.length + 1)] = JSON.parse(val);
}
});
} else if (arguments.length == 1 && typeof key == 'string') {
@ -214,7 +214,7 @@ Ox.Log = (function() {
if (!log.filterEnabled || log.filter.indexOf(args[0]) > -1) {
date = new Date();
args.unshift(
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().substr(-3)
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().slice(-3)
);
window.console && window.console.log.apply(window.console, args);
ret = args.join(' ');
@ -326,7 +326,7 @@ Ox.print = function() {
var args = Ox.toArray(arguments),
date = new Date();
args.unshift(
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().substr(-3)/*,
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().slice(-3)/*,
(arguments.callee.caller && arguments.callee.caller.name)
|| '(anonymous)'*/
);