JsPropertyDescriptor<TValue> Struct
A property descriptor (https://tc39.es/ecma262/#sec-property-descriptor-specification-type).
public readonly struct JsPropertyDescriptor<TValue> where TValue : classType parameters
TValue
Properties
| Name | Description |
|---|---|
| Configurable | Gets the [[Configurable]] attribute. |
| Enumerable | Gets the [[Enumerable]] attribute. |
| Flags | Gets the fields and the boolean attributes of the descriptor. |
| Getter | Gets the [[Get]] field, or null when it is absent. |
| IsAccessorDescriptor | Gets whether the descriptor is an accessor descriptor (https://tc39.es/ecma262/#sec-isaccessordescriptor). |
| IsDataDescriptor | Gets whether the descriptor is a data descriptor (https://tc39.es/ecma262/#sec-isdatadescriptor). |
| Setter | Gets the [[Set]] field, or null when it is absent. |
| Value | Gets the [[Value]] field, or null when it is absent. |
| Writable | Gets the [[Writable]] attribute. |
Configurable
IJsAdapter.csEnumerable
IJsAdapter.csFlags
IJsAdapter.csGets the fields and the boolean attributes of the descriptor.
public JsPropertyFlags Flags { get; }Property value
Getter
IJsAdapter.csGets the [[Get]] field, or null when it is absent.
public TValue? Getter { get; }Property value
TValue?
IsAccessorDescriptor
IJsAdapter.csIsDataDescriptor
IJsAdapter.csSetter
IJsAdapter.csGets the [[Set]] field, or null when it is absent.
public TValue? Setter { get; }Property value
TValue?
Value
IJsAdapter.csGets the [[Value]] field, or null when it is absent.
public TValue? Value { get; }Property value
TValue?
Writable
IJsAdapter.csMethods
| Name | Description |
|---|---|
| Accessor(TValue, TValue, bool, bool) | Creates an accessor property descriptor. getter and setter are functions or undefined. |
| Create(TValue?, TValue?, TValue?, JsPropertyFlags) | Creates a partial descriptor (e.g. the argument of Object.defineProperty). |
| Data(TValue, bool, bool, bool) | Creates a data property descriptor. |
Accessor(TValue, TValue, bool, bool)
IJsAdapter.csCreates an accessor property descriptor. getter and setter are functions or undefined.
public static JsPropertyDescriptor<TValue> Accessor(TValue getter, TValue setter, bool enumerable, bool configurable)Parameters
Returns
Create(TValue?, TValue?, TValue?, JsPropertyFlags)
IJsAdapter.csCreates a partial descriptor (e.g. the argument of Object.defineProperty).
public static JsPropertyDescriptor<TValue> Create(TValue? value, TValue? getter, TValue? setter, JsPropertyFlags flags)Data(TValue, bool, bool, bool)
IJsAdapter.csCreates a data property descriptor.
public static JsPropertyDescriptor<TValue> Data(TValue value, bool writable, bool enumerable, bool configurable)