This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Description
Trying to add items to a Javascript Array fails to add the item for some reason:
var jsTextToInsert = JavaScriptValue.FromString( "String to add to array" );
var arrayObject = JavaScriptValue.GlobalObject.GetProperty( JavaScriptPropertyId.FromString( "myArray") );
var pushFunctionObject = arrayObjectGetProperty( JavaScriptPropertyId.FromString( "push" ) );
var result = pushFunctionObject.CallFunction( JavaScriptValue.GlobalObject, jsTextToInsert );
var length = (int)arrayObject.GetProperty( JavaScriptPropertyId.FromString( "length" ) ).ToDouble();
Debug.Assert( length == 1 );
I can add items to the array using an alternative indexed property approach but it would be nice the 'push' function worked:
JavaScriptValue indexValue = JavaScriptValue.FromInt32( length );
arrayObject.SetIndexedProperty( indexValue, jsFileName );
Any ideas what I am doing wrong, or is this an issue; calling other functions works fine.