public static Object createLiteralObject(params Object[] values)
{
if (values.Length % 2 != 0)
{
throw new ArgumentException("Literal object arguments' length should be even: " + values);
}
AsObject obj = new AsObject();
for (int i = 0; i < values.Length; i += 2)
{
String key = (String) values[i];
Object value = values[i + 1];
obj.setOwnProperty(key, value);
}
return obj;
}