diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index 40dcbde4..6581ef3c 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -142,6 +142,13 @@ Ox.localStorage localStorage wrapper (key) -> <*> returns one value (key, val) -> sets one value, returns localStorage object ({key: val, ...}) -> sets values, returns localStorage object + + > Ox.test.localStorage({foo: 'bar'})('foo') + 'bar' + > Ox.test.localStorage.delete('foo')() + {} @*/ Ox.localStorage = function(namespace) { if (!window.localStorage) { @@ -164,7 +171,7 @@ Ox.localStorage = function(namespace) { Ox.forEach(Ox.makeObject(arguments), function(value, key) { localStorage[namespace + '.' + key] = JSON.stringify(value); }); - ret = this; + ret = storage; } return ret; }; @@ -175,8 +182,6 @@ Ox.localStorage = function(namespace) { keys.forEach(function(key) { delete localStorage[namespace + '.' + key]; }); - var keys = - keys return storage; }; return storage; @@ -257,7 +262,7 @@ Ox.loop For-loop, functional-style step Step value fn Iterator function i Counter value - > Ox.loop(10, function(i) { i == 4 && Ox.Break() }) + > Ox.loop(10, function(i) { i == 4 && Ox.Break(); }) 4 > Ox.loop(0, 3, 2, function() {}) 4 @@ -295,8 +300,7 @@ Ox.print Prints its arguments to the console "foo" @*/ Ox.print = function() { - var args = Ox.toArray(arguments), - date = new Date(); + var args = Ox.toArray(arguments), date = new Date(); args.unshift( Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().slice(-3) );