implementation for to-object-array