JsPropertyDescriptor Struct
A property descriptor (https://tc39.es/ecma262/#sec-property-descriptor-specification-type): complete, or partial (the argument of Object.defineProperty).
public readonly struct JsPropertyDescriptorConstructors
| Name | Description |
|---|---|
| JsPropertyDescriptor(JsValue, JsValue, JsValue, JsPropertyDescriptorFlags) | Creates a descriptor from its fields. |
JsPropertyDescriptor(JsValue, JsValue, JsValue, JsPropertyDescriptorFlags)
JsPropertyDescriptor.csCreates a descriptor from its fields.
public JsPropertyDescriptor(JsValue value, JsValue getter, JsValue setter, JsPropertyDescriptorFlags flags)Parameters
valueJsValuegetterJsValuesetterJsValueflagsJsPropertyDescriptorFlags
Properties
| Name | Description |
|---|---|
| Configurable | Gets the [[Configurable]] attribute. |
| Enumerable | Gets the [[Enumerable]] attribute. |
| Flags | Gets the fields and the attributes. |
| Getter | Gets the [[Get]] field (undefined when absent). |
| IsAccessorDescriptor | Gets whether the descriptor is an accessor descriptor. |
| IsDataDescriptor | Gets whether the descriptor is a data descriptor. |
| Setter | Gets the [[Set]] field (undefined when absent). |
| Value | Gets the [[Value]] field (undefined when absent). |
| Writable | Gets the [[Writable]] attribute. |
Configurable
JsPropertyDescriptor.csEnumerable
JsPropertyDescriptor.csGetter
JsPropertyDescriptor.csIsAccessorDescriptor
JsPropertyDescriptor.csIsDataDescriptor
JsPropertyDescriptor.csSetter
JsPropertyDescriptor.csWritable
JsPropertyDescriptor.csMethods
| Name | Description |
|---|---|
| Accessor(JsValue, JsValue, bool, bool) | Creates a complete accessor descriptor; the getter and the setter are functions or undefined. |
| Data(JsValue, bool, bool, bool) | Creates a complete data descriptor. |
Accessor(JsValue, JsValue, bool, bool)
JsPropertyDescriptor.csCreates a complete accessor descriptor; the getter and the setter are functions or undefined.
public static JsPropertyDescriptor Accessor(JsValue getter, JsValue setter, bool enumerable = false, bool configurable = true)Data(JsValue, bool, bool, bool)
JsPropertyDescriptor.csCreates a complete data descriptor.
public static JsPropertyDescriptor Data(JsValue value, bool writable = true, bool enumerable = true, bool configurable = true)