reordering functions
This commit is contained in:
parent
b2f392a2b5
commit
20564c7fab
1 changed files with 18 additions and 18 deletions
|
@ -136,6 +136,24 @@ Ox.fallback.isArray = function(value) {
|
|||
return Object.prototype.toString.call(value) == '[object Array]';
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.fallback.keys <f> see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys
|
||||
> Ox.fallback.keys({a: 1, b: 2, c: 3})
|
||||
['a', 'b', 'c']
|
||||
@*/
|
||||
Ox.fallback.keys = function(object) {
|
||||
if (object !== Object(object)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
var key, ret = [];
|
||||
for (key in object) {
|
||||
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
||||
ret.push(key);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.fallback.lastIndexOf <f> see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
|
||||
> Ox.fallback.lastIndexOf.call([1, 2, 3, 2, 1], 2)
|
||||
|
@ -247,24 +265,6 @@ Ox.fallback.some = function(iterator, that) {
|
|||
return ret;
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.fallback.keys <f> see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys
|
||||
> Ox.fallback.keys({a: 1, b: 2, c: 3})
|
||||
['a', 'b', 'c']
|
||||
@*/
|
||||
Ox.fallback.keys = function(object) {
|
||||
if (object !== Object(object)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
var key, ret = [];
|
||||
for (key in object) {
|
||||
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
||||
ret.push(key);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.fallback.trim <f> see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim
|
||||
> Ox.fallback.trim.call(' foo ')
|
||||
|
|
Loading…
Reference in a new issue