_.keys returns an empty array when called on arguments object on some browsers regardless of the arguments passed to the function, while on other browsers it is returning an array filled with the stringified keys as taken from the arguments object.
}('one', 'two', 'three'));
Produces the following in Firefox 8, Chrome 15 and Opera 11 and the current WebKit nightly build:
["0", "1", "2"]
While on IE 8 and Safari 5.1, we see an empty array:
This seems to be a combination of how the various browsers implement Object.keys and how they handle arguments objects.
According to ECMA-262 5th Edition, section 10.6, the keys set in the arguments object are supposed to be set to Enumerable, so it seems that at least IE 8 and below and Safari 5.1 and below are behaving badly here.
Yep -- browsers will be browsers.
If you'd like to have more reliable behavior, I'd recommend turning the arguments object into a real array before working on it: