public override PropertyDescriptor GetOwnProperty(string property) { var descriptor = base.GetOwnProperty(property); if (descriptor == PropertyDescriptor.Undefined && IsArrayIndex(property, out var index)) { descriptor = EcmaScriptHelper.CreateArrayIndexAccessor(Engine, _list, (int)index); base.SetOwnProperty(property, descriptor); } return(descriptor); }
public override IEnumerable <KeyValuePair <string, PropertyDescriptor> > GetOwnProperties() { for (var i = 0; i < _list.Count; i++) { var property = i.ToString(NumberFormatInfo.InvariantInfo); if (base.GetOwnProperty(property) == PropertyDescriptor.Undefined) { base.SetOwnProperty(property, EcmaScriptHelper.CreateArrayIndexAccessor(Engine, _list, i)); } } return(base.GetOwnProperties()); }
public override PropertyDescriptor GetOwnProperty(string property) { var descriptor = base.GetOwnProperty(property); if (descriptor != PropertyDescriptor.Undefined) { return(descriptor); } descriptor = EcmaScriptHelper.CreatePropertyAccessor(Engine, _list, property); base.SetOwnProperty(property, descriptor); return(descriptor); }