using System.Runtime.CompilerServices;
using Jint.Runtime.Descriptors;
namespace Jint.Native.Object;
///
/// Fast access helpers which violate JavaScript specification, but helpful when accessed
/// against ObjectInstance and prototype chain is intact.
///
public partial class ObjectInstance
{
///
/// Creates data property without checking prototype, property existence and overwrites any data already present.
///
///
/// Does not conform to JavaScript specification prototype etc. handling etc.
///
public void FastSetProperty(string name, PropertyDescriptor value)
{
SetProperty(name, value);
}
///
/// Creates data property without checking prototype, property existence and overwrites any data already present.
///
///
/// Does not conform to JavaScript specification prototype etc. handling etc.
///
public void FastSetProperty(JsValue property, PropertyDescriptor value)
{
SetProperty(property, value);
}
///
/// Creates data property (configurable, enumerable, writable) without checking prototype, property existence and overwrites any data already present.
///
///
/// Does not conform to JavaScript specification prototype etc. handling etc.
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void FastSetDataProperty(string name, JsValue value)
{
SetProperty(name, new PropertyDescriptor(value, PropertyFlag.ConfigurableEnumerableWritable));
}
}