From a604922ffd733377dc371ecdf41ea3ecca3da059 Mon Sep 17 00:00:00 2001 From: shilei Date: Tue, 23 Apr 2024 09:42:59 +0000 Subject: [PATCH] modify the callback of JSVM_PropertyHandlerConfigurationStruct Signed-off-by: shilei Change-Id: Ide16718679dedfe32eee799522da426f0afdec11 --- ark_runtime/jsvm/jsvm_types.h | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index e46568bed..228830d2c 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -541,42 +541,56 @@ typedef struct { /** A callback function triggered by getting a named property of an instance object. */ JSVM_Value(JSVM_CDECL* genericNamedPropertyGetterCallback)(JSVM_Env env, JSVM_Value name, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value namedPropertyData); /** A callback function triggered by setting a named property of an instance object. */ JSVM_Value(JSVM_CDECL* genericNamedPropertySetterCallback)(JSVM_Env env, JSVM_Value name, JSVM_Value property, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value namedPropertyData); /** A callback function triggered by deleting a named property of an instance object. */ JSVM_Value(JSVM_CDECL* genericNamedPropertyDeleterCallback)(JSVM_Env env, JSVM_Value name, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value namedPropertyData); /** A callback function triggered by getting all named properties requests on an object. */ JSVM_Value(JSVM_CDECL* genericNamedPropertyEnumeratorCallback)(JSVM_Env env, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value namedPropertyData); /** A callback function triggered by getting an indexed property of an instance object. */ JSVM_Value(JSVM_CDECL* genericIndexedPropertyGetterCallback)(JSVM_Env env, - JSVM_Value index, - JSVM_Value thisArg); + JSVM_Value index, + JSVM_Value thisArg, + JSVM_Value indexedPropertyData); /** A callback function triggered by setting an indexed property of an instance object. */ JSVM_Value(JSVM_CDECL* genericIndexedPropertySetterCallback)(JSVM_Env env, JSVM_Value index, JSVM_Value property, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value indexedPropertyData); /** A callback function triggered by deleting an indexed property of an instance object. */ JSVM_Value(JSVM_CDECL* genericIndexedPropertyDeleterCallback)(JSVM_Env env, JSVM_Value index, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value indexedPropertyData); /** A callback function triggered by getting all indexed properties requests on an object. */ JSVM_Value(JSVM_CDECL* genericIndexedPropertyEnumeratorCallback)(JSVM_Env env, - JSVM_Value thisArg); + JSVM_Value thisArg, + JSVM_Value indexedPropertyData); + + /** data will be utilized by the named property callbacks in this struct. */ + JSVM_Value namedPropertyData; + + /** data will be utilized by the indexed property callbacks in this struct. */ + JSVM_Value indexedPropertyData; } JSVM_PropertyHandlerConfigurationStruct; /** -- Gitee