docs: static String toStringIdOrIndex(Context cx, Object id)
      {
          if (id instanceof Number) {
              double d = ((Number)id).doubleValue();
              int index = (int)d;
              if (index == d) {
                  storeIndexResult(cx, index);
                  return null;
              }
              return toString(id);
          }
          String s;
          if (id instanceof String) {
              s = (String)id;
          } else {
              s = toString(id);
          }
          long indexTest = indexFromString(s);
          if (indexTest >= 0) {
              storeIndexResult(cx, (int)indexTest);
              return null;
          }
          return s;
      }