fix Object.keys shim (no one noticed it was broken...)

This commit is contained in:
James Campos 2011-10-28 20:35:40 -07:00
parent b4aea00449
commit ff3bf87589
2 changed files with 3 additions and 4 deletions

View File

@ -168,10 +168,9 @@
} }
if (!Object.keys) { if (!Object.keys) {
Object.keys = function(o) { Object.keys = function(o) {
var key, _i, _len, _results; var key, _results;
_results = []; _results = [];
for (_i = 0, _len = o.length; _i < _len; _i++) { for (key in o) {
key = o[_i];
_results.push(key); _results.push(key);
} }
return _results; return _results;

View File

@ -102,7 +102,7 @@ if console?
# XXX opera cannot into Object.keys # XXX opera cannot into Object.keys
if not Object.keys if not Object.keys
Object.keys = (o) -> Object.keys = (o) ->
key for key in o key for key of o
# flatten the config # flatten the config
conf = {} conf = {}