url controller updates, list bugfixes

This commit is contained in:
rlx 2011-09-28 17:31:35 +00:00
commit 3965eed153
12 changed files with 98 additions and 48 deletions

View file

@ -431,6 +431,8 @@ Ox.clone <f> Returns a (shallow or deep) copy of an object or array
'val'
> (function() { a = {key: 'val'}; b = Ox.clone(a); a.key = null; return b.key; }())
'val'
> Ox.clone(0)
0
@*/
Ox.clone = function(col, deep) {
@ -442,7 +444,9 @@ Ox.clone = function(col, deep) {
? Ox.clone(val, true) : val;
});
} else {
ret = Ox.isArray(col) ? col.slice() : Ox.extend({}, col);
ret = Ox.isArray(col) ? col.slice()
: Ox.isObject(col) ? Ox.extend({}, col)
: col;
}
return ret;
};
@ -670,10 +674,10 @@ Ox.getset = function(obj, args, callback, context) {
var obj_ = Ox.clone(obj), ret;
if (args.length == 0) {
// getset([])
ret = obj;
ret = obj_;
} else if (args.length == 1 && !Ox.isObject(args[0])) {
// getset([key])
ret = obj[args[0]];
ret = Ox.clone(obj[args[0]]);
} else {
// getset([key, val]) or getset([{key: val, ...}])
args = Ox.makeObject(args);