//otherwise get object's string as all ecma primitives will return a valid string representation of themselves
try {
if (dialogValue instanceof Vector) {
Vector v = (Vector)dialogValue;
if(isFive) {
ScriptableImpl s = new ScriptableImpl();
for(int i = 0; i < v.size(); i++) {
s.putElement(i, v.elementAt(i));
}
retVal = s;
} else {
Object[] s = new Object[v.size()];
v.copyInto(s);