public static Object enumInit(Object value, Context cx, boolean enumValues)
    {
        IdEnumeration x = new IdEnumeration();
        x.obj = toObjectOrNull(cx, value);
        if (x.obj != null) {
            // null or undefined do not cause errors but rather lead to empty
            // "for in" loop
            x.enumValues = enumValues;
            // enumInit should read all initial ids before returning
            // or "for (a.i in a)" would wrongly enumerate i in a as well
            enumChangeObject(x);
        }
        return x;
    }