/// <summary> /// Creates a <see cref="JSValue"/> representing an array of <see cref="JSValue"/>. /// </summary> public JSValue(JSValue[] value) { IntPtr jsarray = JSArrayHelper.CreateArray(value); instance = awe_jsvalue_create_array_value(jsarray); JSArrayHelper.DestroyArray(jsarray); }
public string[] GetKeys() { IntPtr jsArray = awe_jsobject_get_keys(instance); uint size = JSArrayHelper.getSize(jsArray); string[] result = new string[size]; for (uint i = 0; i < size; i++) { JSValue temp = JSArrayHelper.getElement(jsArray, i); result[i] = temp.ToString(); } JSArrayHelper.destroyArray(jsArray); return(result); }
/// <summary> /// Gets this value as an Array, this will assert if not an Array type. /// </summary> public JSValue[] GetArray() { return(JSArrayHelper.getArray(awe_jsvalue_get_array(instance))); }