diff --git a/source/Ox/js/Fallback.js b/source/Ox/js/Fallback.js index d1b4db67..efdc0fc4 100644 --- a/source/Ox/js/Fallback.js +++ b/source/Ox/js/Fallback.js @@ -136,6 +136,24 @@ Ox.fallback.isArray = function(value) { return Object.prototype.toString.call(value) == '[object Array]'; }; +/*@ +Ox.fallback.keys 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 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 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 see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim > Ox.fallback.trim.call(' foo ')