attr(key, val) on empty objects.

attr(key, val) on empty objects should return an empty object instead of undefined.