typedef struct {...} JSVM_PropertyHandlerConfigurationStruct Overview
Defines a struct for triggering the corresponding callback when the getter, setter, deleter, or enumerator of an object is executed.
Use scenario: Scenarios where the property operations of JavaScript objects need to be intercepted and processed, such as implementing dynamic property access control and building proxy objects or property listening mechanisms.
Problem solved: Provides a mechanism to intercept and customize the property operation behavior of objects, allowing custom logic to be executed during operations such as property read, write, and delete.
Benefits: Enhances the flexibility and controllability of object operations, and simplifies the implementation logic of property interception.
System capability: SystemCapability.ArkCompiler.JSVM
Since: 12
Related module: JSVM
Header file: jsvm_types.h
[h2]Member Variables
| Name | Description |
| JSVM_Value namedPropertyData | Data used for name property callback. |
| JSVM_Value indexedPropertyData | Data used for index property callback. |
[h2]Callback Members
| Name | Description |
| JSVM_Value (JSVM_CDECL* genericNamedPropertyGetterCallback)(JSVM_Env env,JSVM_Value name,JSVM_Value thisArg,JSVM_Value namedPropertyData) | Callback triggered by obtaining the name property of an instance object. |
| JSVM_Value (JSVM_CDECL* genericNamedPropertySetterCallback)(JSVM_Env env,JSVM_Value name,JSVM_Value property,JSVM_Value thisArg,JSVM_Value namedPropertyData) | Callback triggered by setting the name property of an instance object. |
| JSVM_Value (JSVM_CDECL* genericNamedPropertyDeleterCallback)(JSVM_Env env,JSVM_Value name,JSVM_Value thisArg,JSVM_Value namedPropertyData) | Callback triggered by deleting the name property of an instance object. |
| JSVM_Value (JSVM_CDECL* genericNamedPropertyEnumeratorCallback)(JSVM_Env env,JSVM_Value thisArg,JSVM_Value namedPropertyData) | Callback triggered by obtaining all name properties of an object. |
| JSVM_Value (JSVM_CDECL* genericIndexedPropertyGetterCallback)(JSVM_Env env,JSVM_Value index,JSVM_Value thisArg,JSVM_Value indexedPropertyData) | Callback triggered by obtaining the index property of an instance object. |
| JSVM_Value (JSVM_CDECL* genericIndexedPropertySetterCallback)(JSVM_Env env,JSVM_Value index,JSVM_Value property,JSVM_Value thisArg,JSVM_Value indexedPropertyData) | Callback triggered by setting the index property of an instance object. |
| JSVM_Value (JSVM_CDECL* genericIndexedPropertyDeleterCallback)(JSVM_Env env,JSVM_Value index,JSVM_Value thisArg,JSVM_Value indexedPropertyData) | Callback triggered by deleting the index property of an instance object. |
| JSVM_Value (JSVM_CDECL* genericIndexedPropertyEnumeratorCallback)(JSVM_Env env,JSVM_Value thisArg,JSVM_Value indexedPropertyData) | Callback triggered by obtaining all index properties of an object. |
Callback Member Description
[h2]genericNamedPropertyGetterCallback()
JSVM_Value (JSVM_CDECL* genericNamedPropertyGetterCallback)(JSVM_Env env,JSVM_Value name,JSVM_Value thisArg,JSVM_Value namedPropertyData)
Description
Callback triggered by obtaining the name property of an instance object.
[h2]genericNamedPropertySetterCallback()
JSVM_Value (JSVM_CDECL* genericNamedPropertySetterCallback)(JSVM_Env env,JSVM_Value name,JSVM_Value property,JSVM_Value thisArg,JSVM_Value namedPropertyData)
Description
Callback triggered by setting the name property of an instance object.
[h2]genericNamedPropertyDeleterCallback()
JSVM_Value (JSVM_CDECL* genericNamedPropertyDeleterCallback)(JSVM_Env env,JSVM_Value name,JSVM_Value thisArg,JSVM_Value namedPropertyData)
Description
Callback triggered by deleting the name property of an instance object.
[h2]genericNamedPropertyEnumeratorCallback()
JSVM_Value (JSVM_CDECL* genericNamedPropertyEnumeratorCallback)(JSVM_Env env,JSVM_Value thisArg,JSVM_Value namedPropertyData)
Description
Callback triggered by obtaining all name properties on an object.
[h2]genericIndexedPropertyGetterCallback()
JSVM_Value (JSVM_CDECL* genericIndexedPropertyGetterCallback)(JSVM_Env env,JSVM_Value index,JSVM_Value thisArg,JSVM_Value indexedPropertyData)
Description
Callback triggered by obtaining the index property of an instance object.
[h2]genericIndexedPropertySetterCallback()
JSVM_Value (JSVM_CDECL* genericIndexedPropertySetterCallback)(JSVM_Env env,JSVM_Value index,JSVM_Value property,JSVM_Value thisArg,JSVM_Value indexedPropertyData)
Description
Callback triggered by setting the index property of an instance object.
[h2]genericIndexedPropertyDeleterCallback()
JSVM_Value (JSVM_CDECL* genericIndexedPropertyDeleterCallback)(JSVM_Env env,JSVM_Value index,JSVM_Value thisArg,JSVM_Value indexedPropertyData)
Description
Callback triggered by deleting the index property of an instance object.
[h2]genericIndexedPropertyEnumeratorCallback()
JSVM_Value (JSVM_CDECL* genericIndexedPropertyEnumeratorCallback)(JSVM_Env env,JSVM_Value thisArg,JSVM_Value indexedPropertyData)
Description
Callback triggered by obtaining all index properties on an object.