dont try to look at the keys of zero-length arrays or arguments objects when calling each()
(cherry picked from commit 30329c051bdee2ae771d7b4cb6552a1ea977a4f0)