From 9c066b112ca1f80d44d2de078cd424ec7188130e Mon Sep 17 00:00:00 2001 From: jiang-qunchao Date: Sun, 28 Apr 2024 10:18:29 +0800 Subject: [PATCH] add interface OH_JSVM_Equals Signed-off-by: jiang-qunchao --- ark_runtime/jsvm/jsvm.h | 16 ++++++++++++++++ ark_runtime/jsvm/libjsvm.ndk.json | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index f303a5968..2dc39225b 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -1423,6 +1423,22 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StrictEquals(JSVM_Env env, JSVM_Value rhs, bool* result); +/** + * @brief This API represents the invocation of the Relaxed Equality algorithm. + * Returns true as long as the values are equal, regardless of type. + * + * @param env: The environment that the API is invoked under. + * @param lhs: The JavaScript value to check. + * @param rhs: The JavaScript value to check against. + * @param result: Whether the two JSVM_Value objects are relaxed equal. + * @return Returns JSVM_OK if the API succeeded. + * @since 12 + */ +JSVM_EXTERN JSVM_Status OH_JSVM_Equals(JSVM_Env env, + JSVM_Value lhs, + JSVM_Value rhs, + bool* result); + /** * @brief This API represents the invocation of the ArrayBuffer detach operation. * diff --git a/ark_runtime/jsvm/libjsvm.ndk.json b/ark_runtime/jsvm/libjsvm.ndk.json index 268d2d010..3f828a2cb 100644 --- a/ark_runtime/jsvm/libjsvm.ndk.json +++ b/ark_runtime/jsvm/libjsvm.ndk.json @@ -570,5 +570,9 @@ { "first_introduced": "12", "name": "OH_JSVM_DefineClassWithPropertyHandler" + }, + { + "first_introduced": "12", + "name": "OH_JSVM_Equals" } ] -- Gitee