目录

JSVM_PropertyHandler

typedef struct {...} JSVM_PropertyHandler

Overview

Defines the pointer to the callback function triggered when a class is called as a function, and the pointer collection of the callback function triggered when an instance object property is accessed.

Use scenario: Used to intercept and customize the function call behavior of an object, and to implement custom logic for property access.

Features: Supports triggering a custom callback when an instance object is called as a function, and triggering the corresponding callback function when an instance object property is accessed.

Problems solved: Implements the proxy pattern for objects and customizes the function call behavior. Provides an interception mechanism for property access, enhancing code flexibility and extensibility.

System capability: SystemCapability.ArkCompiler.JSVM

Since: 18

Related module: JSVM

Header file: jsvm_types.h

Summary

[h2]Member Variables

Name Description
JSVM_PropertyHandlerCfg propertyHandlerCfg Callback triggered when an instance object property is accessed.
JSVM_Callback callAsFunctionCallback Callback triggered when an instance object is called as a function.