diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 462e0203dc8193cd75db1aa81b76f0b3a22df56e..80148b9629bd9407d0ccbf0d423a7dfa67de0ec5 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -2639,6 +2639,61 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsObject(JSVM_Env env, JSVM_EXTERN JSVM_Status OH_JSVM_IsBigInt(JSVM_Env env, JSVM_Value value, bool* isBigInt); + +/** + * @brief This API returns a JSVM-API value corresponding to a JavaScript Set type. + * + * @param env: The environment that the API is invoked under. + * @param result: A JSVM_Value representing a JavaScript Set. + * @return Returns JSVM function's result code. + * {@link JSVM_OK } If the API succeeded.\n + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_CreateSet(JSVM_Env env, + JSVM_Value* result); + +/** + * @brief This API checks if the value passed in is a Set. + * + * @param env: The environment that the API is invoked under. + * @param value: The JavaScript value to check. + * @param isSet: Whether the given value is Set. + * @return Returns JSVM function's result code. + * {@link JSVM_OK } If the API succeeded.\n + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_IsSet(JSVM_Env env, + JSVM_Value value, + bool* isSet); + +/** + * @brief This API returns the Object prototype. + * + * @param env: The environment that the API is invoked under. + * @param object: JSVM_Value representing JavaScript Object whose prototype to return. This returns + * the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype property). + * @param result: JSVM_Value representing prototype of the given object. + * @return Returns JSVM function's result code. + * {@link JSVM_OK } If the API succeeded.\n + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_ObjectGetPrototypeOf(JSVM_Env env, + JSVM_Value object, + JSVM_Value* result); + +/** + * @brief This API set the prototype on the Object passed in. + * + * @param env: The environment that the API is invoked under. + * @param object: The object on which to set the prototype. + * @param prototype: The prototype value. + * @return Returns JSVM function's result code. + * {@link JSVM_OK } If the API succeeded.\n + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_ObjectSetPrototypeOf(JSVM_Env env, + JSVM_Value object, + JSVM_Value prototype); EXTERN_C_END /** @} */ diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index e290f2815c9dc6dd3958b2c2be17c80201ce6b49..e3aeac41ae23126f25dffc6f31e02f1fd231f8cb 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -642,5 +642,21 @@ { "first_introduced": "12", "name": "OH_JSVM_Equals" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_CreateSet" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_IsSet" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_ObjectGetPrototypeOf" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_ObjectSetPrototypeOf" } ]